Open acodeninja opened 8 months ago
@acodeninja can you provide more context on why you are using both packages? Specifically interested in what you are using the ngrok-api package for.
Hi, thanks for taking a look @salilsub. The specific use case was for a Python app, live-questions.
The app hosts a flask application over an ngrok tunnel and presents a TUI app with a QR Code pointing to the ngrok domain.
I wanted to use this library to retrieve a list of ngrok domains for users to choose from. As a workaround I've used various subprocess.call
instances to get the information needed from the ngrok CLI.
These calls are usually very fragile when working cross-os so I'd like to use both libraries. I also feel both the ngrok
and ngrok-api
packages should be capable of being installed at the same time.
I just ran into the same. I'm trying to create a reserved address (api lib) and then use that address to connect a TCP tunnel (sdk lib).
I'm running into the same limitation, which is blocking me from using ngrok-api. I'm using the ngrok agent sdk to create and manage tunnels for the user programmatically, and I want to use the ngrok api in the same app to do things like list the available custom domains.
A solution could be to use namespace packages
Replication:
pip install ngrok
pip install ngrok-api
Create a new file called
test.py
python test.py
Results in:
Cause
The package
ngrok
andngrok-api
both contain the same published package folderngrok
.ngrok-api
seems to take precedence:Suggested fix
Update this package to expose the package directory
ngrok_api
which might be a better choice.