Changing the host from 127.0.0.1 to a public IP

Does anyone have any tips for configuring this application to run on a host other than 127.0.0.1 ?

EDIT:
I found that you can specify a host in the run.py file by adding it as a parameter in the app.run() function call within the run.py file:
app.run(host=‘0.0.0.0’)

Using 0.0.0.0 as your host will make the application listen on all IP addresses.

I found the information about adding the argument heree:
http://flask.pocoo.org/docs/1.0/quickstart/#a-minimal-application

EDIT 2:
The status page will be broken unless you update the frontend to use your IP rather than localhost. If you’re on linux you can use the following script to update the files:
for filepath in $(grep -R localhost -l);do sed -i ‘s/localhost/111.111.111.111/g’ $filepath;done
You must run this script from the mflix directory.
You must also replace 111.111.111.111. with your public IP address.

2 Likes

You can also go into index.html and edit the host information in the window.mflix section. Remove “localhost:5000” and replace with an empty string, i.e. window.host = "". This should allow you to serve the application from any location.

Funnily enough the window.host is already blank in the “index.html” for the November download. Still, the app only listens on 127.0.0.1:5000.

Ah well, I did a quick work-around by simply setting up an SSH tunnel to the port 5000 on the VM that runs my app.