Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A host in a LAN with IP ( TCP port 8888) connects to a server without knowing there is a NAT box at the network edge. The NAT box is dumb and just translates port 8888 to some other port 5555 and changes the IP to the public IP address (say and saves in a dictionary the key, value pair: (5555,

When it receives a reply it does the reverse translation and forwards the packet back to the host. How is the operation of an HTTP proxy different from this? I understand the proxy can do other stuff like filtering, caching etc but how is the basic operation of the proxy different from a NAT box?

share|improve this question

migrated from Nov 4 '11 at 6:39

This question came from our site for professional and enthusiast programmers.

HTTP proxy won't work for anything except HTTP.

It won't work for OpenVPN connections, it won't work for P2P traffic, multiplayer 3D games etc.

NAT is good for all kinds TCP of traffic. Many of them also handle UDP and ICMP (in limited way, as ICMP doesn't have ports).

share|improve this answer

NAT works at a lower protocol level - it is only rewriting the IP address and port; it doesn't otherwise disrupt the TCP connection (and thus it's mostly transparent to the higher-level protocols).

A HTTP proxy does something quite different: first, the TCP connection terminates there, and it opens a completely different connection to the target host. Second, it does its own processing and transformations on the HTTP requests and responses.

share|improve this answer
Where can I read more about the internal working of an HTTP proxy? – Bruce Nov 4 '11 at 19:19

They are similar in many ways, they are both Gateways. A HTTP proxy operates on the level of a HTTP request. A router performing NAT operates at the level of TCP/IP connection. Many network routers also perform both functions.

share|improve this answer
"they are both Gateways" - and the similarity ends right there. – Piskvor Nov 4 '11 at 7:46
I don't see why the downvote anyway... – m0skit0 Nov 4 '11 at 8:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .