ngrok / ngrok-api-python Goto Github PK
View Code? Open in Web Editor NEWngrok API client library for Python
License: MIT License
ngrok API client library for Python
License: MIT License
The ngrok-api package hard-specifies a version of requests, which is 2 years back. This specification model causes problems with pip and especially poetry. Pip displays a warning during installation if a newer application package is installed in the virtual environment. Poetry prohibits installation.
Because no versions of ngrok-api match >0.8.0,<0.9.0
and ngrok-api (0.8.0) depends on requests (2.25.1), ngrok-api (>=0.8.0,<0.9.0) requires requests (2.25.1).
And because [...] depends on requests (>=2.28.2,<3.0.0)
and no versions of [...] match >1.1.2,<2.0.0, ngrok-api (>=0.8.0,<0.9.0) is incompatible with [...] (>=1.1.2,<2.0.0).
So, because [xxxx] depends on both [...] (^1.1.2) and ngrok-api (^0.8.0), version solving failed.
I would like to implement one of the 2 following solutions :
Strategy 1 : Could you declare this dependency by authorizing the use of intermediate version (^2.25.1 instead of ==2.25.1). Knowing that in case of warning with pip, this is already what is done. We're running ngrok-api with a newer version of requests ?
Strategy 2 : Could you update the requests package used more regularly ?
Thanks a lot for your work.
When I create a reserved domain, I get the following error while the domain is created in ngrok.
>>> import os
>>> import ngrok
>>> ng = ngrok.Client(os.getenv('API_KEY'))
>>> ng.reserved_domains.create(name="test.example.com")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/takehiko.kodama/Documents/test/ngrok/env/lib/python3.9/site-packages/ngrok/services.py", line 2487, in create
return ReservedDomain(self._client, result)
File "/Users/takehiko.kodama/Documents/test/ngrok/env/lib/python3.9/site-packages/ngrok/datatypes.py", line 2694, in __init__
ReservedDomainCertStatus(client, props["certificate_management_status"])
File "/Users/takehiko.kodama/Documents/test/ngrok/env/lib/python3.9/site-packages/ngrok/datatypes.py", line 2849, in __init__
ReservedDomainCertJob(client, props["provisioning_job"])
File "/Users/takehiko.kodama/Documents/test/ngrok/env/lib/python3.9/site-packages/ngrok/datatypes.py", line 2907, in __init__
if props["ns_targets"] is not None
KeyError: 'ns_targets'
Just found this repo / pypi package. Really nice to see this available.
Just one minor question, since the documentation is quite technical, and does not refer to functionality but only to technical features.
I want to use this library to create a tunnel like I do during normal development on a daily basis, using the cli: ngrok http 5000
. But I cannot find the actual endpoint that I need to use for that. Is this even possible, or is there more to it?
I am not able to setup ngrok tunnel
bellow is the error I am facing
The ngrok process errored on start: Your ngrok-agent version "2.3.41" is too old. The minimum supported agent version for your account is "3.2.0". Please update to a newer version with
ngrok update, by downloading from https://ngrok.com/download, or by updating your SDK version. Paid accounts are currently excluded from minimum agent version requirements. To begin handling traffic immediately without updating your agent, upgrade to a paid plan: https://dashboard.ngrok.com/billing/subscription.\r\n\r\nERR_NGROK_121\r\n.
Please let me know if there is any temprory fix
I have tried updating the ngrok version in the pip packge
pip install ngrok
pip install ngrok-api
test.py
import ngrok
ngrok.forward("http://localhost:8080")
python test.py
Results in:
Traceback (most recent call last):
File "test/test.py", line 3, in <module>
ngrok.forward("http://localhost:8080")
^^^^^^^^^^^^^^
AttributeError: module 'ngrok' has no attribute 'forward'
The package ngrok
and ngrok-api
both contain the same published package folder ngrok
. ngrok-api
seems to take precedence:
ls python3.11/site-packages/ngrok
__init__.py __main__.py __pycache__ client.py datatypes.py error.py http_client.py iterator.py mypy.ini ngrok.abi3.so ngrok.pyi ngrok_parser.py py.typed services.py utils.py
Update this package to expose the package directory ngrok_api
which might be a better choice.
ngrok-api 0.10.0
if __name__ == "__main__":
client = ngrok.Client("<token>")
for ses in client.tunnel_sessions.list():
client.tunnel_sessions.stop(ses.id)
ngrok.error.Error: (Error(...), 'You did not provide a Content-Type with your request. Please check your API client implementation and use one of the supported content types: https://ngrok.com/docs/api#content-types')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.