View Full Version : can i force connecting to local web server via internet network ?
umen242
04-28-2008, 01:11 AM
Hello all
this is general question , if i have web server installed in my local pc and i have client that connecting to that web server
can i force it always to go via the internet network ?
the reason im asking is .. that im noticed when i close my internet connection i still can connect to my web server.
manav
04-29-2008, 12:55 AM
you can always connect to a local server using "127.0.0.1" or "localhost" addresss, so to make sure you connect only when internet connection is up, you should connect to your server using the same address that is used to access it over the internet.
i suppose you should be already using a server address which is available over internet, and i am confused that, why, you still have a problem :(
matsp
04-29-2008, 02:28 AM
Most network stacks knows it's own IP address, so even if you send to 192.168.0.1, it will know that you don't need to go out on the real network to get there...
--
Mats
brewbuck
04-29-2008, 08:48 AM
Most network stacks knows it's own IP address, so even if you send to 192.168.0.1, it will know that you don't need to go out on the real network to get there...
--
Mats
Yes, you'd have to have some very weird routes to cause a packet to leave the network it's already destined for. People do that sort of thing when testing networks, but I doubt there's any real "network" here (just a PC connected to an ISP?)
CornedBee
04-29-2008, 08:52 AM
And the other question is, why would you want to do that anyway?
abachler
04-29-2008, 09:21 AM
Other than writing a bounce server or rewriting your socket stack, no there is no way of doing it. The IP stack correctly forwards any packets not destined for the local machine to the gateway. A call to teh recv function sorts throught eh packets in teh socket stack and returns any that are bound for the associated socket. There is no way to force the socket stack to send a packet out to the gateway, only to then recieve it back, as it woudl then immediately send it out again until the TTL was exhausted and the packet would be dropped. I suppose if you are runnign a linux distro you could make the socket stack forward any packets with a TTL above a certain value, but why woudl you want to do this anyway?
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.