examplecode / mproxy

c 语言实现的一个最小的http代理,支持翻墙
990 stars 378 forks source link

rfc要求代理从absolute uri中提取host,而不是从host 头部字段中提取 #14

Open lxydotcom opened 8 years ago

lxydotcom commented 8 years ago

因为历史兼容性的原因,根据http1.0/1.1规范,代理必须从absolute uri中提取host,而不是从host head field中提取。

https://tools.ietf.org/html/rfc2616#section-5.1.2 The absoluteURI form is REQUIRED when the request is being made to a proxy. ... Note that the proxy MAY forward the request on to another proxy or directly to the server specified by the absoluteURI.

section-5.2

1. If Request-URI is an absoluteURI, the host is part of the Request-URI. Any Host header field value in the request MUST be ignored.