来自参考链接2
对客户端/浏览器来说Web
代理服务器是服务器
对服务器来说Web
代理服务器是客户端
WireShark
Charles
macOS 10.13.6
根据参考链接1中的这段话
Web proxy servers
Web proxies forward HTTP requests. The request from the client is the same as a regular HTTP request except the full URL is passed, instead of just the path.[17]
GET http://en.wikipedia.org/wiki/Proxy_server HTTP/1.1
Proxy-Authorization: Basic encoded-credentials
Accept: text/html
Web
代理服务器在转发HTTP
请求时与正常的HTTP
是一样的,除了请求头某个字段要传递全路径(full URL
)而不是简单的路径(path
)。继续追踪,通过rfc7230,就能知道这个这个字段就是absolute-form
。
为什么会有这个变化呢? 原来只要传路径是因为,服务器知道自己的host是什么,但是代理服务器是充当了客户端的服务器后,我们必须要告诉代理服务器,接下去要访问谁,光提供路径是不够的。
iTerm ping Blog
的域名,获得ip
% sudo ping www.iosugar.com
PING ishepherdminer.github.io (185.199.111.153): 56 data bytes
64 bytes from 185.199.111.153: icmp_seq=0 ttl=52 time=141.981 ms
...
打开 WireShark
监听 en0
网卡,当前状态下就是无线网卡
设置过滤条件http and ip.addr == 185.199.111.153
Chrome
直接访问www.iosugar.com
手机设置代理,用Safari
访问
过滤条件设置为 http and ip.addr == 185.199.110.153 or ip.dst == 192.168.31.191
其中192.168.31.191
是计算机的地址