WebApp可通过localhost访问,但不能通过127.0.0.1访问 [英] WebApp accessible via localhost but not 127.0.0.1
问题描述
我在我的机器(Win7 pro X64)上使用Maven在Jetty上运行一个Web应用程序,并且遇到了一些奇怪的问题:
i'm running a webapp on Jetty with Maven on my machine (Win7 pro X64) and i'm experiencing some weird problems:
- 当我尝试在浏览器中打开它时-可通过
localhost
而不是127.0.0.1
或我的本地地址(192.168.0.14
)访问. - 当我本地网络中的其他人尝试访问该应用程序时,他可以通过我的计算机名而不是我的本地地址来访问它.
- when i try to open it on my browser - it's accessible via
localhost
but not127.0.0.1
or my local address (192.168.0.14
). - when someone else from my local network tries to access the app he can do it via my computer name but not via my local address.
注意:
- ping适用于localhost和
127.0.0.1
.另外,我可以使用telnet访问127.0.0.1
(80). - Windows防火墙已关闭(已停止服务)
- 主机文件中未定义任何内容
- 清洁
DNS
和ARP
茶歇无济于事 - 在网络中的其他计算机上,该应用程序运行正常,我可以通过其ip访问它.我们都共享相同的
pom.xml
. - 错误说-链接似乎是
- ping works for localhost and
127.0.0.1
. also, i can access127.0.0.1
(80) with telnet. - windows firewall is off (stopped the service)
- nothing defined in hosts file
- cleaning
DNS
andARP
chache didn't help - on other computers in the network the app works fine and i can access it via their ip. we all share the same
pom.xml
. - error says - "link appears to be
请帮助我找出到底是什么问题
please help me find out what the hell can be the problem
谢谢...
推荐答案
一个晚上的尝试后,我认为我发现了问题- Skype !
after a looong evening of trying pretty much everything i think i found the problem - Skype!
在8080年成功运行码头之后,我咨询了一位朋友,他告诉了我有关Skype的问题.关闭skype后,码头在端口80上也可以完美运行:)
after running jetty successfully on 8080 i consulted a friend and he told me about the skype issue. after shutting down skype, jetty runs perfectly on port 80 as well :)
after a quick search i found this - http://www.mydigitallife.info/disable-skype-from-using-opening-and-listening-on-port-80-and-443-on-local-computer/
注意:出于某种原因,在这种情况下,Jetty不会抛出像服务器那样的异常
NOTE: for some reason Jetty isn't throwing an exception like a server should in this situation
这篇关于WebApp可通过localhost访问,但不能通过127.0.0.1访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!