HTTP代理服务器是否修改请求数据包? [英] Do HTTP proxy servers modify request packets?

查看:1373
本文介绍了HTTP代理服务器是否修改请求数据包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在代理服务器转发到服务器之前,是否有任何请求标头被添加或修改为HTTP请求?

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?

推荐答案

有几种不同类型的代理服务器。因为您已经提到了请求标头,我将假设您正在谈论转发HTTP请求的HTTP代理服务器,而不是数据包。

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.

注意: HTTPS请求的特殊情况下(TLS / SSL通过 CONNECT ),代理服务器只是转发TCP数据包的内容(并且无法检查数据包,除非作为中间人代理。

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).

当然这取决于代理软件及其配置,但HTTP代理预期遵循W3C Web内容转换代理指南 ,其中陈述了许多内容,但是最相关的:

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:


  • 除了在 HEAD 和<$之间进行转换c $ c> GET 代理人不得改变请求方法。

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

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

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.

除了RFC 2616所需的修改之外,HTTP代理不应修改 User-Agent 接受 Accept-Charset 接受编码 Accept-Language 标题字段,不得删除标题字段。

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.

代理应添加请求发起者的IP地址到 X-Forwarded-For中逗号分隔列表的末尾 HTTP标头字段。

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.

代理必须(根据RFC 2616)包含通过 HTTP标题字段。

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

总之,您通常可以期望这些HTTP标头由符合标准的代理更改/添加:

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


  • 用户代理

  • 接受

  • Accept-Charset

  • 接受编码

  • 接受语言

  • X-Forwarded-For

  • 通过

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

这篇关于HTTP代理服务器是否修改请求数据包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆