1

I'm new to Web App so I'm sorry if this is a simple question.

I enter: ngrok http 5000

Then when I go to the correct https address I get the message below.

The connection to https://e71eb98330fe.ngrok.io was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address 127.0.0.1:5000.
Make sure that a web service is running on 127.0.0.1:5000 and that it is a valid address.
The error encountered was: dial tcp 127.0.0.1:5000: connect: connection refused

According to this answer:

I need to set up a web server and point it to local host 5000.

But my error is slightly different and even when I try going to: localhost:5000 It doesn't work.

Is the problem just that I need to point a web server to 5000? How do I do that?

DuDa
  • 3,718
  • 4
  • 16
  • 36
Tom Mason
  • 11
  • 2
  • Do you have a web server running on your local machine? If not, what are you running ngrok for? – seumasmac Jan 29 '21 at 17:49
  • @seumasmac I don't have a web server running on my local machine, how do I do that? I'm following this video: https://www.youtube.com/watch?v=5hdrW6yEwro because I want to be able to share a URL with someone and then they join a video chat with me/others and I think I need ngrok for that part – Tom Mason Jan 29 '21 at 17:51
  • Hi Tom, I had a quick look at your video. You question kind of needs that context :) When the guy runs `python app.py` <- *that* is the web service that is listening on port 5000 (that's your web server). You need to have that running in one terminal, and then you should be able to do the ngrok thing in another terminal tab. All the ngrok service is saying is that there is nothing listening on port 5000 so you're obviously not running that command at the same time, or it didn't give the same output `http://0.0.0.0:5000/` that you can see in the video. – seumasmac Jan 29 '21 at 18:24
  • You're right that 0.0.0.0:5000/ doesn't show up when I enter python app.py Instead what I get is: raceback (most recent call last): File "/Users/thomasmason/Downloads/flask-twilio-video/app.py", line 13, in twilio_client = Client(twilio_api_key_sid, twilio_api_key_secret, File "/Users/thomasmason/Downloads/flask-twilio-video/venv/lib/python3.9/site-packages/twilio/rest/__init__.py", line 47, in __init__ raise TwilioException("Credentials are required to create a TwilioClient") twilio.base.exceptions.TwilioException: Credentials are required to create a TwilioClient" – Tom Mason Jan 29 '21 at 20:03
  • Is python messed up @seumasmac? This is my 2nd week of proagramming so I've never used it I've just been messing around in html/css up until now – Tom Mason Jan 29 '21 at 20:05
  • That means it isn't started. The error "Credentials are required to create a TwilioClient" is what's wrong. There's an earlier bit in the video where the guy puts some credentials in a text file. You need to do that and make sure the file is in the right place for the python program to read it. I don't know anything about this particular program but that's the source of your issue. Once you manage to start it successfully, and it's listening on port 5000, the rest should just work. – seumasmac Jan 29 '21 at 23:19
  • 1
    And good luck with your programming. I know it can be frustrating to start with as it seems there are a million different things you have to know, but after a while you start to see the same things appear again and you'll say "I've seen this before, or something similar..." and it'll start to make a bit more sense :) – seumasmac Jan 29 '21 at 23:21
  • Okay, I'm going to look into it. Thanks for the help :) – Tom Mason Jan 30 '21 at 23:17

0 Answers0