gpt4 book ai didi

http - 为什么 HTTP 代理能够支持像 IRC 和 FTP 这样的协议(protocol)?

转载 作者:可可西里 更新时间:2023-11-01 15:04:32 29 4
gpt4 key购买 nike

我了解 SOCKS 代理仅在 TCP 级别建立连接,而 HTTP 代理在 HTTP 级别解释流量。因此,SOCKS 代理可以用于任何类型的协议(protocol),而 HTTP 代理只能处理 HTTP 流量。但是为什么像 Squid 这样的 HTTP Proxy 可以支持像 IRC,FTP 这样的协议(protocol)呢?当我们使用 HTTP 代理进行 IRC 或 FTP 连接时,具体会发生什么?通过 HTTP 协议(protocol)发送到代理时,是否有任何元数据添加到包中?

最佳答案

如果 HTTP 代理支持主要用于 HTTPS 连接的 CONNECT 方法,它就能够支持 HTTP 以外的高级协议(protocol),这里是来自 Squid wiki 的描述:

The CONNECT method is a way to tunnel any kind of connection through an HTTP proxy. By default, the proxy establishes a TCP connection to the specified server, responds with an HTTP 200 (Connection Established) response, and then shovels packets back and forth between the client and the server, without understanding or interpreting the tunnelled traffic

如果客户端软件支持通过启用“HTTP CONNECT”的 (HTTPS) 代理进行连接,它可以是任何可以与此类代理一起工作的高级协议(protocol)(VPN、SSH、SQL、版本控制等)

关于http - 为什么 HTTP 代理能够支持像 IRC 和 FTP 这样的协议(protocol)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12026247/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com