简体   繁体   中英

Custom http service responds fine to local IP address but NOT to localhost or 127.0.0.1

I'm trying to connect to a custom http service written by another developer.

The service responds fine on a local IP address and port number. Such as: http://10.1.1.1:1234 but it does NOT respond to http://localhost:1234 or http://127.0.0.1:1234

The service is a simple single function application written in VC++ that takes an http post string and returns another string.

I'm trying to all it from C# using HttpWebRequest.GetResponse, but I can reproduce the same problem manually from a web browser...

Test environment is Windows 2008 Server.

Bottom line I'm looking for some troubleshooting tips to help the other developer fix his code.

The HTTP server socket is bound to the network ip of the server. It needs to be bound to all the interfaces on the host machine. (this will include the loopback interface, localhostor 127.0.0.1)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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