2

For testing purposes, I am using my machines ip provided by the isp as the address to connect to the server from my phone(my machine/pc is the server). Since ipaddresses are unique in the internet, I should be able to access it.
But what if my pc is behind a proxy? First of all will my ipaddress be visisble to the internet? Will the proxy server forward the packets to my machine?
The proxy requires Authentication. I also have a username and password for the proxy.

Ashwin
  • 307
  • 1
  • 4
  • 13

1 Answers1

3

If a machine is behind a proxy, all requests to services that go through the proxy are "anonymized", at least as far as IP address goes. Reply traffic comes back to the proxy, which then forwards the response to the machine the made the original request.

Since ipaddresses are unique in the internet, I should be able to access it.

Negative, ghostrider. There are several issues here. First is that all IP addresses are not unique. See RFC1918. With regards to non-RFC1918 addresses (and with the exception of some multicast IPs, etc.), then yes, they should be globally-unique. That said, I've seen some pretty bone-headed moves by companies just assuming they can just pick arbitrary netblocks to use, but that's beside the point.

Even with globally-unique addresses, though, you have routers and firewalls to deal with. It's perfectly conceivable (and quite common) for an organization to have a huge block of "public" IP addresses locked up behind a corporate firewall. In this situation, requests from these IPs might be routed directly or the might be routed through a NAT or proxy. You never know.

EEAA
  • 109,363
  • 18
  • 175
  • 245
  • okay.. I thought two machines connected to the internet cannot have the same ip address at all. but I saw this link http://stackoverflow.com/questions/2689728/identify-machines-behind-a-router-uniquely-based-on-ipaddress and there are actually two machines having the same ipaddress. So what will happen if I use one of those machines as the server and access the it using its ipaddress from my phone? – Ashwin Apr 29 '12 at 01:59
  • I went through the rfc. I understood that two machines can never have the same ip if they are connected to the internet directly. but can two machines behind two different routers connected to the internet have the same ip address. I understood that it is possible with a proxy because you said with proxy the reply is only sent to the proxy's ipaddress. But what about routers. When you connect to a server via a router, the reply comes back to the originating pc's ipaddress and not to the router's address although eventually the router forwards it to the pc, right? – Ashwin Apr 29 '12 at 02:14
  • As mentioned in my answer, it completely depends on how the router is configured. Some will route requests directly, some will NAT requests, and some will force traffic through a proxy. – EEAA Apr 29 '12 at 02:19
  • In your answer you mentioned that a proxy maintains anonymity, i.e. the server reply's to the proxy thinking that it is the client. how does the proxy server forward the reply to the computer that originally made the request? – Ashwin Apr 29 '12 at 05:13
  • Is it possible that proxy and nat be both present? Because my machine is connected to the internet via proxy. But when I went to http://whatismyip.com , There was a different address than that of the proxy server ip. So does the traffic first go to a proxy server then to then to the nat router? – Ashwin Apr 30 '12 at 05:12
  • @Ashwin - yes, either of these are possible, though it's more probable that the proxy would live on the "private" side of the NAT. – EEAA Apr 30 '12 at 08:32