如何改变前夕的IP地址? [英] How to change eve's IP address?

查看:99
本文介绍了如何改变前夕的IP地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行 api.py 时,默认IP地址是 127.0.0.1:5000 这是本地的主办。我在服务器端运行前夕脚本。我可以将该IP地址更改为服务器的地址吗?或者我只是使用服务器的地址访问它。

When I run the api.py the default IP address is 127.0.0.1:5000 which is the local host. I am running the eve scripts on the server side. Am I able to change that IP address to server's address? or Am I just access it using server's address.

例如,如果服务器的地址是 11.5.254.12 ,则
,然后我运行 api.py
我可以使用 11.5.254.12:5000 在服务器外访问它,还是有办法从 127.0更改它。 0.1 11.5.254.12

For example, if the server's address is 11.5.254.12, then I run the api.py. Am I able to access it outside of the server using 11.5.254.12:5000 or is there any way to change it from 127.0.0.1 to 11.5.254.12?

推荐答案

将参数添加到 app.run()。默认情况下,它在localhost上运行,将其更改为 app.run(host ='0.0.0.0')以在您的计算机IP地址上运行。

Add a parameter to your app.run(). By default it runs on localhost, change it to app.run(host= '0.0.0.0') to run on your machine IP address.

这篇关于如何改变前夕的IP地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆