Manga-Colorizer
Manga-Colorizer copied to clipboard
Ngrok error
I'm trying to run this in colab. !pip install pyngrok from pyngrok import ngrok ngrok.set_auth_token("auth_token") public_url = ngrok.connect(5000).public_url print(public_url)
Then Start the python app-stream.py
Got this error: ERR_NGROK_3004 ngrok gateway error
The server returned an invalid or incomplete HTTP response.
Get help with this error
Just use it like:
!pip install pyngrok
!ngrok config add-authtoken {NGROK_AUTHTOKEN}
!ngrok http 5000
Or if you want to run in a separate thread with static domain:
import subprocess
ngrok_process = None
def run_ngrok():
global ngrok_process
command = ["ngrok", "http", f"--domain={NGROK_STATIC_DOMAIN}", "5003"]
ngrok_process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
for line in ngrok_process.stdout:
print(line.strip())
def stop_ngrok():
global ngrok_process
if ngrok_process:
ngrok_process.terminate()
For start:
ngrok_thread = threading.Thread(target=run_ngrok, daemon=True)
ngrok_thread.start()
For stop:
stop_ngrok()
ngrok_thread.join()