-2

I've connected my PC with other server using AnyVPN and PuTTy. Then I've made simple flask python app (code below):

from flask import Flask

app = Flask(__name__)

@app.route('/')
def homepage():
    return "Hi there, how ya doin?"

if __name__ == "__main__":
    app.run(')

When I've tried running that - it was working. Terminal displayed '* Running on http://127.0.0.1:5000/' but when i opened the browser and typed that link - my browser didn't display anything. What's more, i haven't root permissions on this server and i've seen that Forwarding function is disabled.

Do you have any idea how can I resolve that?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Oskarro
  • 323
  • 2
  • 9

1 Answers1

0

Firstly, 127.0.0.1 is the loopback address - which is used the refer the same machine (local machine) where this address is looked on.

Since, you have hosted the application in a different server, you can access the application with the IP of that machine which you used to login in PuTTy.

Type http://<ip_of_remote_machine>:5000 in your browser to connect to your application.

veri_pudicha_coder
  • 1,411
  • 9
  • 9
  • I've done it with app.run() and app.run('0.0.0.0') and then i've typed 10.133.223.150 (inet adress) into browser and always result is the same. – Oskarro Oct 19 '18 at 10:24
  • After that, webbrowser display that: "the connetction has timed out". – Oskarro Oct 19 '18 at 10:26
  • 10.x.x.x cannot be the public IP address of your server. It is reserved for private usage.. – xrisk Oct 19 '18 at 10:26
  • It's my university server and we have to create simple web app based on flask python. I needn't run it public, but i want to just run my project on that server – Oskarro Oct 19 '18 at 10:32
  • Solved - i haven't noticed that you explain me login issue - i've just used it the same what i've typed in putty and it works! Thanks! – Oskarro Oct 19 '18 at 10:39