What localhost port is serving my app on Windows 10?

I'm a newb to the Windows development environment and I have cloned a git repository for a python+javascript project I developed on my Mac (Unix). I have the environment set up and have the script running but when I open Chrome and go to localhost:5000 where it would be on my Unix environment, it's not there. How do I find the correct port where it's served up on Windows 10?

My run.py script is (the first line is for Unix use on my other machine):

#!/usr/bin/env python
from app import app
app.run(host = '0.0.0.0', debug = True)
0

1 Answer

What I would do, if I were you is identify the running process in the Task Manager and grab it's PID. From there, I would open a command prompt, and use the netstat command to get a list of all active connections:

netstat -ano

From there, simply find a line where the last column have your PID number, and you should find which port it's running on (under the Local Address column).

Alternatively, you could pipe the output of netstat to a find command with the PID for an easier time.

netstat -ano | find /i "$PID_NUMBER"

For this to work though, you'll have to be able to identify your app process in the Task Manager (you can add the "Command line" column to see how a process is launched, it might help you identify it).

7

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like