问题描述
我正在移动网站上工作,并希望使用我的iPhone浏览器进行测试。我的Windows 7机器和iPhone在同一个无线网络上。如何从iPhone访问localhost?现在我得到404错误。
I am working on a mobile website and would like to test it using my iPhone browser. My Windows 7 machine and iPhone are on the same wireless network. How do I access localhost from the iPhone? Right now I get a 404 error.
推荐答案
从iPhone访问localhost只会做一个环回/尝试连接到自己(如果它支持?)。
Accessing localhost from the iPhone will simply do a loopback / try to connect to itself (If it supports that?).
您需要做的是找到桌面计算机的IP(例如,如果是Windows,请转到命令提示
并键入 ipconfig
或转到网络和共享中心
并查找连接状态
。
What you need to do is find the IP of your desktop machine (e.g. If Windows, go to the Command Prompt
and type ipconfig
or go to Network and Sharing Centre
and look up connection status
.
一旦你有了你的ip,只需从你的浏览器访问它,例如 http:/ /192.168.0.102
。
Once you have your ip, simply visit that from your browser e.g. http://192.168.0.102
.
您可能需要在入站安全性中打开端口80(或运行您网站的任何端口)防火墙,如果你正在运行它。
You may need to open up port 80 (or whatever port your website is running on) in the inbound security of your firewall if you are running one.
这篇关于如何从iPhone浏览器访问在localhost上运行的网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!