ngrok / ngrok-python

Embed ngrok secure ingress into your Python apps with a single line of code.
https://ngrok.com
Apache License 2.0
103 stars 19 forks source link

How to use ngrok python sdk to enable ngrok Agent API #94

Closed banhao closed 3 months ago

banhao commented 4 months ago

Before I used pyngrok and ngrok Agent API 'http://127.0.0.1:4040/api/tunnels' was enabled by default. So when I switch to use ngrok, I don't know how to enable the ngrok Agent API 'http://127.0.0.1:4040/api/tunnels' by using ngrok

Abdiramen commented 4 months ago

Are you looking for a web interface for ngrok-python? If so, that doesn't exist in ngrok-python yet.

banhao commented 4 months ago

So will you add this feature in the future? Thanks!

bobzilladev commented 4 months ago

Hello! There is a Python library for interacting with the server-side API which can be used along side the SDK, which may provide the functionality you are looking for, that can be found here: https://github.com/ngrok/ngrok-api-python

banhao commented 4 months ago

I need Web Interface which is looks like this gnrok-inspect-tab Can check the request and response data, header, raw data, etc.

bobzilladev commented 4 months ago

Ah, for analyzing traffic there is a product update coming on the horizon, see the Traffic Inspection section of the docs for information around that.

banhao commented 4 months ago

Ah, for analyzing traffic there is a product update coming on the horizon, see the Traffic Inspection section of the docs for information around that.

yes, but how to enable it by using python import ngrok? Seems it is not enable by default when using listener = ngrok.forward(5000, authtoken_from_env=True)

bobzilladev commented 4 months ago

Aye, the local web interface is only for the Agent. But going forward both the Agent and the SDK's will populate data in the cloud based traffic inspector in the ngrok dashboard.

salilsub commented 3 months ago

I'm going to mark this as a "not planned". We won't be making any direct changes to the python SDK, but the recommended solution is to use our traffic inspector on the ngrok dashboard.