Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do HTTP proxy servers modify request packets?

Is any request header added or modified to the HTTP request before forwarding to the server by a proxy server?

If so, are the changes done to the same packets, or are the contents used to create new request packets with the modifications?

like image 971
Ashwin Avatar asked Apr 29 '12 04:04

Ashwin


People also ask

What does a HTTP proxy do?

The HTTP-proxy is a high-performance content filter. It examines Web traffic to identify suspicious content that can be a virus or other type of intrusion. It can also protect your HTTP server from attacks. WatchGuard recommends you use HTTP Proxy policies for any HTTP traffic between your network and external hosts.

Can proxy server modify traffic between a client and server?

A proxy server, sometimes referred to as a forward proxy, is a server that routes traffic between client(s) and another system, usually external to the network. By doing so, it can regulate traffic according to preset policies, convert and mask client IP addresses, enforce security protocols, and block unknown traffic.

Is proxy based on request?

Proxy servers receive requests intended for other servers and then act to fulfill, forward, redirect, or reject the requests.

What 3 protocols does the proxy handle?

Proxy Server implements all product features by using the following three services: Web Proxy service Provides caching, cache routing (CARP), support for chains, and reverse proxying.


1 Answers

There are a few different types of proxy servers. Because you've mentioned request headers, I'm going to assume that you're talking about HTTP proxy servers, which forward HTTP requests, not packets.

NOTE: In the special case of HTTPS requests (TLS/SSL via CONNECT), proxy servers will just forward the content of the TCP packets (and are unable to inspect the packets unless acting as a man-in-the-middle proxy).


Of course it depends on the proxy software and its configuration, but HTTP proxies are expected to follow the W3C Guidelines for Web Content Transformation Proxies, which states many things, but most relevantly:

  • Other than to convert between HEAD and GET proxies must not alter request methods.

  • If the request contains a Cache-Control: no-transform directive, proxies must not alter the request other than to comply with transparent HTTP behavior defined in RFC 2616 HTTP sections section 14.9.5 and section 13.5.2 and to add header fields as described in 4.1.6 Additional HTTP Header Fields.

  • Other than the modifications required by RFC 2616 HTTP proxies should not modify the values of header fields other than the User-Agent, Accept, Accept-Charset, Accept-Encoding, and Accept-Language header fields and must not delete header fields.

  • Proxies should add the IP address of the initiator of the request to the end of a comma separated list in an X-Forwarded-For HTTP header field.

  • Proxies must (in accordance with RFC 2616) include a Via HTTP header field.


In summary, you can generally expect these HTTP headers to be changed/added by a standards-compliant proxy:

  • User-Agent
  • Accept
  • Accept-Charset
  • Accept-Encoding
  • Accept-Language
  • X-Forwarded-For
  • Via
like image 190
Xenon Avatar answered Oct 20 '22 16:10

Xenon