Netty HTTPProxyHandler 总是发送一个 CONNECT [英] Netty HTTPProxyHandler always sends a CONNECT

查看:128
本文介绍了Netty HTTPProxyHandler 总是发送一个 CONNECT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HTTPProxyHandler 总是发送 CONNECT 请求是对的吗?这不是只适用于你想要做隧道的时候吗?

Is it right that HTTPProxyHandler always sends a CONNECT request? Isn't this only applicable when you want to do tunneling?

推荐答案

HTTPProxyHandler 不知道你是只想对 http 数据进行隧道传输,还是想在连接的瞬间发起 http 请求,因此,它猜测在这两种情况下都适用的选项,因为标准补充 HTTP 代理支持 CONNECT 和旧的 http 代理方法调用.如果您需要使用 GET 和其他方法实现 HTTP 代理,只需将连接作为普通 HTTP 连接进行线程化,但指定完整的 url,包括 url 中的 http:// 部分.

HTTPProxyHandler does not know if you only want to tunnel http data, or want to make http request at the moment of connection, therefore, it guesses the option that works in both cases, since a standard complements HTTP proxy supports both the CONNECT and the old http proxy method call. If you need to implement a HTTP proxy using GET and other methods, just thread the connection as a normal HTTP connection, but specify the full url including the http:// part in the url.

这篇关于Netty HTTPProxyHandler 总是发送一个 CONNECT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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