从另一台不在网络上的计算机访问localhost [英] Access localhost from another computer not on network

查看:330
本文介绍了从另一台不在网络上的计算机访问localhost的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在你说这是一个骗局之前,这与这个这个

Before you say that it is a dupe, this is not the same as this, this, this or this.

我的问题是你如何在全球范围内做到这一点。

My question is how do you do it globally.

例如,考虑一下。我的EasyPHP在我的电脑上运行。目前我的IP地址(全球)是223.231.178.118

For instance, consider this. I have EasyPHP running in my computer. At present my ip address (global) is 223.231.178.118

现在,假设还有其他人(可能在不同的国家/地区)想要访问我的IP( 223.231.178.118)。我知道如何从同一网络访问192.168.x.x.我想知道你如何在全球范围内做到这一点。

Now, let's say there is someone else (maybe in a different country altogether) who wants to access my ip (223.231.178.118). I do know how to access 192.168.x.x from the same network. I just want to know how you can do this globally, if possible.

PS 1:运行EasyPHP的电脑是在路由器后面。

P.S 1 : The computer running EasyPHP is behind a router.

PS 2:我的IP(本地IP是,但全局IP不是)不是静态的。但是,让我们假设想要访问我的localhost的人确实知道我的动态IP。例如,让我们假设我告诉想要访问我的本地主机的人是我的朋友,我通过电话告诉他我的IP是什么。

P.S 2 : My IP (local IP is, but global one is not) is not static. But let us assume the person who wants to access my localhost does know my Dynamic IP. For example, let us assume I tell the person who wants to access my localhost is my friend and I tell him over phone what my IP is.

推荐答案

您的本地IP地址192.168.xx仅为路由器所知,并且LAN外的所有人都不知道。全局IP地址(在您的示例中为223.231.178.118)是路由器的全局地址。

Your local IP address "192.168.x.x" is only known to your router and unknown to everyone outside your LAN. The global IP address (223.231.178.118 in your example) is the global address of your router.

为了能够访问本地计算机上的EasyPHP服务器,您需要转发相应的端口(对于http网络服务器,默认值为80但EasyPHP可能不同)从您的路由器到您的本地IP。您需要检查路由器手册,了解如何执行此操作。

To be able to access the EasyPHP server on your local computer you need to forward the corresponding port (for http webservers the default is 80 but it might be different for EasyPHP) from your router to your local IP. You need to check your routers manual on how to do this.

完成后,您可以告诉想要访问本地计算机的人全局IP地址您的路由器将通过浏览到该全球地址来查看您的EasyPHP响应。

After you have done that you can just tell the person who wants to access your local computer the global ip address of your router and he will see your EasyPHP response by browsing to that global address.

这篇关于从另一台不在网络上的计算机访问localhost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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