跳至正文
Wener Notes

HTTP Proxy

约 1 分钟阅读
  • HTTP CONNECT 方法
    • 只能 HTTP 1.1
text
CONNECT github.com:443 HTTP/1.1
Host: github.com:443
User-Agent: curl/7.64.1
Proxy-Connection: Keep-Alive
text
HTTP/1.1 200 Connection Established
Proxy-agent: nginx
X-Proxy-Connected-Addr: 13.229.188.59:443

HAProxy

Nginx

bash
nginx -V | grep http_proxy_connect_module
nginx
server {
    listen  443;

    # dns resolver used by forward proxying
    resolver  114.114.114.114;

    # forward proxy for CONNECT request
    proxy_connect;
    proxy_connect_allow            443;
    proxy_connect_connect_timeout  10s;
    proxy_connect_read_timeout     10s;
    proxy_connect_send_timeout     10s;

    # forward proxy for non-CONNECT request
    location / {
        proxy_pass http://$host;
        proxy_set_header Host $host;
    }
}

关联信息

反向链接、本文链接的其他页面和外部资料。

参考资料

GitHub2 条
Hacker News1 条
最近更新commit 76db02a编辑