-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Region for lower latency #64
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
import nest_asyncio | ||
import uvicorn | ||
from pyngrok import ngrok | ||
from pyngrok import ngrok, conf | ||
|
||
|
||
try: | ||
|
@@ -26,13 +26,15 @@ def __init__( | |
password=None, | ||
authtoken=None, | ||
mount_drive=False, | ||
region="us", | ||
code=True, | ||
lab=False, | ||
): | ||
self.port = port | ||
self.password = password | ||
self.authtoken = authtoken | ||
self._mount = mount_drive | ||
self.region = region | ||
self._code = code | ||
self._lab = lab | ||
if self._lab: | ||
|
@@ -60,6 +62,7 @@ def _install_extensions(): | |
subprocess.run(["code-server", "--install-extension", f"{ext}"]) | ||
|
||
def _start_server(self): | ||
conf.get_default().region = self.region | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please pass region in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've tried it out but it does not work by doing that. That's why I have used this method as mentioned in pyngrok docs (https://pyngrok.readthedocs.io/en/latest/#setting-the-region). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello Sir, Could you please review this? I've tried the change you mention but it doesn't seem to work. |
||
if self.authtoken: | ||
ngrok.set_auth_token(self.authtoken) | ||
active_tunnels = ngrok.get_tunnels() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed