简体   繁体   English

如何将web.py服务器打开到Web?

[英]How do I open up the web.py server to the web?

I would like people on the web to be able to enter something into the address bar of their browser and use the web.py app I have written. 我希望网络上的人能够在浏览器的地址栏中输入内容并使用我编写的web.py应用程序。 I have it working properly when I type localhost:8080/app but I want other people to be able to use it, with my home computer acting as the server. 当我键入localhost:8080 / app时我能正常工作,但我希望其他人能够使用它,我的家用电脑充当服务器。 I know this must be an obvious question (the package is called web.py, after all), but I haven't been able to figure out exactly what steps to take to make that happen. 我知道这一定是一个显而易见的问题(毕竟这个包叫做web.py),但是我还没弄清楚到底要采取什么步骤来实现这个目标。 I guess the link would need to be to my IP address, rather than a URL? 我想链接需要是我的IP地址,而不是URL? Do I need to configure my router somehow? 我需要以某种方式配置我的路由器吗?

First you need to find your external IP google("what is my IP") 首先你需要找到你的外部IP谷歌(“我的IP是什么”)

在此输入图像描述

Second you need to set up a port forward on your router to redirect traffic from an external port to an internal port. 其次,您需要在路由器上设置前向端口,以将流量从外部端口重定向到内部端口。

在此输入图像描述

After the port forwarding is complete you should be able to navigate to http://<your external ip>:<port>/ 端口转发完成后,您应该能够导航到http://<your external ip>:<port>/

First you need to set up port forwarding on your router: Configure it so port 80 of your router forwards to port 8080 of your computer. 首先,您需要在路由器上设置端口转发:配置它,使路由器的端口80转发到计算机的端口8080。 (You can find your computers internal IP-address in your operating systems network config) You might also need to set your computer to use a static IP-address and disable DHCP. (您可以在操作系统网络配置中找到计算机内部IP地址)您可能还需要将计算机设置为使用静态IP地址并禁用DHCP。

Then other users will be able to access your server via your routers external IP-address. 然后其他用户将能够通过您的路由器外部IP地址访问您的服务器。 You can find out your external IP here . 您可以在此处找到您的外部IP。 You might also want to set up a Dynamic DNS address so others can still access the server when your external IP-address changes. 您可能还需要设置动态DNS地址,以便其他人在外部IP地址更改时仍可访问服务器。 An example of such a service is noip 这种服务的一个例子是noip

As long as you're just doing some basic testing using your own computer is good enough but once you're running a real web service you should consider using a paid external webhosting service to improve security, reliability and performance. 只要您使用自己的计算机进行一些基本测试就足够了,但是一旦运行真正的Web服务,您应该考虑使用付费外部虚拟主机服务来提高安全性,可靠性和性能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM