简体   繁体   English

HTTP代理服务器是否修改请求数据包?

[英]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? 是否在代理服务器转发到服务器之前,是否向HTTP请求添加或修改了任何请求标头?

If so, are the changes done to the same packets, or are the contents used to create new request packets with the modifications? 如果是,是对相同的数据包进行了更改,还是用于创建带有修改的新请求数据包的内容?

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. 因为您已经提到了请求标头,我将假设您正在谈论HTTP代理服务器,它转发HTTP请求,而不是数据包。

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). 注意:HTTPS请求 (通过CONNECT TLS / SSL)的特殊情况下,代理服务器仅转发TCP数据包的内容(并且除非充当中间人代理,否则无法检查数据包)。


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: 当然,这取决于代理软件和它的配置,但HTTP代理预计遵循W3C 的Web内容转换代理指南 ,其中指出很多东西,但最贴切:

  • Other than to convert between HEAD and GET proxies must not alter request methods. 除了在HEADGET代理之间进行转换之外,不得更改请求方法。

  • 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 . 如果请求包含Cache-Control: no-transform指令,代理不得更改请求,除了遵守RFC 2616 HTTP部分第14.9.5节和第13.5.2节中定义的透明HTTP行为,并添加标题字段,如上所述4.1.6其他HTTP标头字段

  • 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. 除了RFC 2616 HTTP代理所需的修改之外,不应修改除User-AgentAcceptAccept-CharsetAccept-EncodingAccept-Language头字段之外的头字段的值,并且不得删除头字段。

  • 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. 代理应将请求的发起者的IP地址添加到X-Forwarded-For HTTP头字段中逗号分隔列表的末尾。

  • Proxies must (in accordance with RFC 2616) include a Via HTTP header field. 代理必须(根据RFC 2616)包含Via HTTP头字段。


In summary, you can generally expect these HTTP headers to be changed/added by a standards-compliant proxy: 总之,您通常可以期望这些HTTP标头由符合标准的代理更改/添加:

  • User-Agent
  • Accept
  • Accept-Charset
  • Accept-Encoding
  • Accept-Language
  • X-Forwarded-For
  • Via

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何修改在 HTTP 代理中发送的请求? - How to modify a request being sent in a HTTP proxy? 如何处理阻止特定HTTP请求方法的代理服务器? - How to deal with proxy servers that block specific HTTP request methods? 数据包如何通过代理服务器到达Destination? - How packets reaches Destination through proxy servers? Burp Extension以捕获,修改和转发HTTp数据包 - Burp Extension to capture, modify and forward HTTp packets 如果许多客户端请求相同的资源,反向代理服务器是否每次都会发出新请求? - If many clients request the same resource do reverse proxy servers make new request each time? Python、Scapy 和 Netfilterqueue 只拦截从客户端到服务器的 HTTP 数据包 - Python, Scapy and Netfilterqueue only intercepts HTTP packets from clients to servers 如何将HTTP请求转发回浏览器? 代理Java - How do i forward the HTTP request back to the browser? Proxy Java 像我们在curl中一样,如何在clojure http请求中设置'no proxy'? - How to set 'no proxy' in clojure http request like we do in curl? 如果未在GET请求中指定HTTP版本,为什么服务器不等待HTTP标头? - Why do servers not wait for http headers if the http version is not specified in a GET request? 从我的iPhone捕获HTTP请求数据包 - Capture HTTP request packets from my iPhone
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM