Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pavitrashah
Copy link

Added a region argument to ColabCode class so users can choose their closest location and have lower latency. And added description and example of that in README.

The available regions are:

us - United States (default)
eu - Europe
ap - Asia/Pacific
au - Australia
sa - South America
jp - Japan
in - India

@@ -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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please pass region in options here: url = ngrok.connect(addr=self.port, options={"bind_tls": True})

Copy link
Author

Choose a reason for hiding this comment

The 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).

Copy link
Author

Choose a reason for hiding this comment

The 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.

@@ -4,7 +4,7 @@

import nest_asyncio
import uvicorn
from pyngrok import ngrok
from pyngrok import ngrok, conf
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed

Copy link
Contributor

@misalraj misalraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for 'Kaggle & Colab', So, by default US reason is fine now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants