处理HTTPS CONNECT请求 [英] Handling HTTPS CONNECT request

查看:1108
本文介绍了处理HTTPS CONNECT请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CONNECT请求不能与HttpWebRequest一起使用,它们总是会抛出404找不到的异常,或者底层连接已关闭。我认为这是因为它们是HTTPS而不是HTTP。那么当需要处理CONNECT请求时,究竟可以做些什么呢? (发送连接请求并收回响应)我稍后会将响应写入TCPClient流。

The CONNECT request don't work with HttpWebRequestand they always throw exceptions like 404 not found, or underlying connection closed. I think it is because they are HTTPS and not HTTP. So when requiring to handle CONNECT requests what exactly can be done? (Sending Connect Request and collecting back the Response) I will write the response later to a TCPClient stream.

推荐答案

CONNECT是一种保留的方法用于调整(参见: https://tools.ietf.org/html/rfc2616#section-9.9 [ ^ ])。

另一方面,HttpWebRequest实现代理支持 [ ^ ]。

你的目的是什么?
CONNECT is a method reserved for tunelling (see: https://tools.ietf.org/html/rfc2616#section-9.9[^]).
On the other hand, HttpWebRequest implements proxy support[^].
What is your purpose with it?


这篇关于处理HTTPS CONNECT请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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