Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

A host in a LAN with IP (10.0.0.1 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 205.209.96.96) and saves in a dictionary the key, value pair: (5555,10.0.0.1:8888).

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 stackoverflow.com Nov 4 '11 at 6:39

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

add comment

3 Answers

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
add comment

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.