I can't preview this appliation using AWS Cloud9 (c9) python flask:
from flask import Flask
import os
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
host = 'localhost' # '0.0.0.0' #"127.0.0.1" # I tried all of these ip's
if __name__ == '__main__':
app.debug = True
port = int(os.environ.get("PORT", 8080)) # I also tried port was 5000
app.run(host=host, port=port)
# This is the error I got 52.15.73.96 The connection has timed out
#The server at 52.15.73.96 is taking too long to respond.
This is similar to AWS cloud9 timeout when running flask application
Here is the answer: You have to get past the AWS firewall. You have to
Add this rule:
Here is a screen shot link: https://i.sstatic.net/xpW5F.jpg
AWS does have this, buried, in their C9 documentation. https://docs.aws.amazon.com/cloud9/latest/user-guide/app-preview.html#app-preview-share-security-group In Share a Running Application over the Internet, Step 2: Set Up the Security Group for the Instance