koi icon indicating copy to clipboard operation
koi copied to clipboard

How do I set my ngrok authtoken?

Open jameshfisher opened this issue 3 years ago • 5 comments

I ran all of the notebook in colab, but requests fail with responses like:

$ curl -X POST http://2e04-34-90-174-157.ngrok.io/api/img2img
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1201  100  1201    0     0   2327      0 --:--:-- --:--:-- --:--:--  2332<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="author" content="ngrok">
    <meta name="description" content="ngrok is the fastest way to put anything on the internet with a single command.">
    <meta name="robots" content="noindex, nofollow">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link id="style" rel="stylesheet" href="https://cdn.ngrok.com/static/css/error.css">
    <noscript>Before you can serve HTML content, you must sign up for an ngrok account and install your authtoken. (ERR_NGROK_6022)</noscript>
    <script id="script" src="https://cdn.ngrok.com/static/js/error.js" type="text/javascript"></script>
  </head>
  ...
</html>

I've signed up for an ngrok account and got an authtoken, but how do I set it in this environment?

jameshfisher avatar Sep 01 '22 20:09 jameshfisher

The notebook runs pip install ngrok - is that https://pypi.org/project/ngrok/?

Is it supposed to be https://pypi.org/project/pyngrok/ ?

jameshfisher avatar Sep 01 '22 20:09 jameshfisher

Okay, I got it running by:

  1. Changing pip install ngrok to pip install pyngrok
  2. Running !ngrok authtoken <myauthtokenhere> immediately after

jameshfisher avatar Sep 01 '22 21:09 jameshfisher

have you confirmed wether this is still necessary inside of colab? or is this an issue for non-colab notebooks?

nousr avatar Sep 04 '22 16:09 nousr

@nousr I'm fairly sure this is an issue in Colab. Ngrok requires an authtoken, and fails if you don't set it, so when the user is setting up a new Colab instance, they somehow need to set their ngrok authtoken.

@guumaster it sounds like you also experienced this? Could you confirm?

jameshfisher avatar Sep 05 '22 09:09 jameshfisher

Exactly, just followed this instructions. Maybe it should be added to README/notebook guide.

guumaster avatar Sep 05 '22 10:09 guumaster