question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using Google Colab and ngrok to serve it temporarily

See original GitHub issue

I have tried following to serve and activate using ngrok in google colab but I am not getting it work. I have changed http to tcp.

Setup Google Colab

  1. Visit https://colab.research.google.com/
  2. Sign in / Sign up using google account
  3. Create new note book

Get authorised ngrok tunnel

  1. Download ngrok Google Colab
!wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
  1. Unzip
!unzip ngrok-stable-linux-amd64.zip
  1. Sign up at ngrok and get authtoke
!./ngrok authtoken <your-auth-token>
  1. Start ngrok and python kms server
!./ngrok tcp 8081 & python3 /content/py-kms/py-kms/pykms_Server.py 0.0.0.0 8081

Thanks for maintaining the project

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
Matthew-Beckettcommented, Dec 7, 2022

Hi, I think this is because you’ve configured Ngrok as a HTTP tunnel and as a result, Ngrok is attempting to terminate and re-establish a HTTP connection to an RPC service running on a plain TCP port. I think you should be able to resolve this by running ngrok tcp 1688. Thanks,Matt07.12.2022, 19:12, “kryptoniancode” @.***>: I have tried following to serve and activate using ngrok in google colab but I am not getting it work. Setup Google Colab

Visit https://colab.research.google.com/ Sign in / Sign up using google account Create new note book

Install and run ngrok

Intall

!pip install pyngrok==4.1.1

Get tunnel using ngrok

from pyngrok import ngrok public_url = ngrok.connect(port=‘8000’) print (public_url)

Run python kms server

!python3 /content/py-kms/py-kms/pykms_Server.py 0.0.0.0 8000

Error These are following errors in ngrok, google colab and activating office google colab This errors come when the link opened in browser.

ngrok When opening the url in browser.

office Note: In above image Invalid RPC request type 84. come from browser when url opened in browser. When setting the url as ngrok using sethst does nothing.

Following can also be done to get authorised ngrok tunnel

Download ngrok Google Colab

!wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip

Unzip

!unzip ngrok-stable-linux-amd64.zip

Sign up at ngrok and get authtoke

!./ngrok config add-authtoken <your-auth-token>

Start ngrok and python kms server

!python3 pykms_Server.py 0.0.0.0 1688 & ngrok http 1688

If above issues can be resolved then it be easier activate lower end devices without installing docker, virtual machine, wsl2 etc. Thanks for maintaining the project

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

1reaction
Matthew-Beckettcommented, Dec 7, 2022

@simonmicro can you close this as resolved and also give me permission to close issues?

Side note: I did reply via email about using ngrok tcp but appears it was not delivered and added to the thread.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Quickly share ML WebApps from Google Colab using ngrok ...
Basically, ngrok takes something available/hosted on your localhost and exposes it to the internet with a temporary public URL (Note: you can ...
Read more >
How can I work with ngrok in google colab? - Stack Overflow
I am using this workaround with ngrok in Google Colab. My goal is to tunnel some dataframe to a public url so that...
Read more >
Quickly deploy ML WebApps from Google Colab using ngrok
This video demos how to quickly and also temporarily deploy ML Web Applications from Google Colab (Web App built using JupyterDash, ...
Read more >
Introduction to Flask using google colab and ngrok - YouTube
Showing a basic example (or two) of the Flask python library in google colab.
Read more >
Deploy-Web-Apps-Using-Google-Colab-and-Ngrok - GitHub
The objective of these projects is to help Machine Learning Engineers and Data Scientists to share their Web App Development with the world...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found