Hello all. I have made a web server in c++; I am able to type in my browser http://localhost , this will contact my server and make a connection i can add a variable onto the end separated with a ?. I want to send messages to my web server it this way. this is going as planned and working well. The next step that has drove me made for 3 days, is why cant i type in my ip address into my browser and have it do the same thing. In my mind this is how chat servers and clients works and it could work, im just missing a step. please help before i pop! thanks

Whether you type in a host name or IP address in your browser, the result of getting to your web server should be the same. However, in the HTTP packet, the headers will look different. You may want to take a packet capture to take a look at the differences. On most web server applications, you control what to do with the HTTP packets by looking at the host headers. I suspect that something in your code is not accommodating the data when it comes in as an IP rather than a hostname.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.