简体   繁体   English

环回127.0.0.1在Win 7中不起作用

[英]Loopback 127.0.0.1 not working in win 7

I am trying to communicate with comms from a server to a client on the same PC. 我正在尝试与从服务器到同一台PC上的客户端的通讯进行通信。 So if I send the word "Hello" from one it appears on the other like a chat program. 因此,如果我从一个发送“ Hello”一词,则它像聊天程序一样出现在另一个消息上。 As I am on one PC I set IP to 127.0.0.1 and port to 7000 although port could be lots of other numbers. 当我在一台PC上时,我将IP设置为127.0.0.1,将端口设置为7000,尽管端口可能有很多其他数字。 When I press to connect it will not connect to local host. 当我按连接时,它将不会连接到本地主机。

On XP laptop all is OK so something in set-up is not good. 在XP笔记本电脑上一切正常,因此设置不佳。 I looked at opening Firefox and typed in Local Host it works, tried 127.0.0.1 it works so IIS is working BUT that is not what I want. 我查看了打开Firefox的过程,然后输入了Local Host,它工作正常,尝试使用127.0.0.1,因此IIS在工作,但不是我想要的。 I looked for files with local host in and find in C:\\Windows\\System32\\drivers\\etc a file called hosts with 127.0.0.1 and IPv6 version ::1 commented out. 我查找了具有本地主机的文件,并在C:\\ Windows \\ System32 \\ drivers \\ etc中找到了一个名为hosts的文件,该文件具有127.0.0.1和IPv6版本:: 1。 Uncommented and still nothing works. 不加注释,仍然没有任何效果。

Switched off firewall still no good, switched off Virus detection still nothing. 关闭防火墙仍然不好,关闭病毒检测仍然没有。

What have I missed how can a chat program talk on loopback in Win7? 我想念什么聊天程序如何在Win7中以环回方式进行交谈?

I'm not sure if you are intentionally typing in Local Host separately. 我不确定您是否有意分别输入“本地主机”。 The host "localhost" is what you are after, followed by the appropriate port number. 主机“ localhost”是您要使用的,后跟适当的端口号。

Example: 例:

http://localhost:7000/url_to_chat http:// localhost:7000 / url_to_chat

If you have been doing that correctly, then you just need to define two different ports for each app if you are running both on the same machine in Windows 7 and done. 如果您做得正确,那么只要您都在Windows 7的同一台计算机上运行并且已完成,则只需为每个应用程序定义两个不同的端口。

If you are using Visual Studio's IIS Express (recommended as you don't have to run as an admin), all you have to do is specify the port number and create the folder. 如果您使用的是Visual Studio的IIS Express(建议您不必以管理员身份运行),则只需指定端口号并创建文件夹。 You'll then have to run each app. 然后,您必须运行每个应用程序。

在此处输入图片说明

Hope that helps. 希望能有所帮助。

Try this site for information on how to change your hosts file: 请尝试在此站点上获取有关如何更改主机文件的信息:

https://bowerwebsolutions.com/how-to-edit-your-local-host-file-for-testing-web-sites/ https://bowerwebsolutions.com/how-to-edit-your-local-host-file-for-testing-web-sites/

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

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