.NET - 是否可以使用 HttpListener 和 HttpListener 代理 HTTPS 请求? HttpWeb 请求? (或者由于加密而不可能?)
问题 - 是否可以使用 HttpListener 和 HttpListener 代理 HTTPS 请求? HttpWeb 请求? (或者由于加密而不可能?)
我有一个通过使用 HttpListener 和 HttpListener 工作的 .NET 代理。使用此处方法的 HttpWebRequest 。我目前正在尝试扩展它以侦听 HTTPS(参考这个问题)但是我想知道我是否正在尝试解决一些不可能的事情......也就是说,如果此代码通过侦听 HTTPS 请求来工作(使用 HttpListener)然后复制标头和内容跨到新的 HttpWebRequest,这是否有缺陷,因为它可能无法解密请求以获取内容?
但是普通的代理服务器显然可以代理 HTTPS,所以我想它可能会起作用,因为它只会复制加密的内容?
Question - Is it possible to proxy a HTTPS request using HttpListener & HttpWebRequest? (or is it not possbile due to the encryption?)
I have got a .NET proxy working by using HttpListener & HttpWebRequest using the approach here. I'm trying to extend this at the moment to listen for HTTPS too (refer this question) however I'm wondering if I'm trying to tackle something that is not possible...That is if this code works by listening for the HTTPS request (using HttpListener) and then copying headers & content across to a new HttpWebRequest, is this flawed as it may not be able to decrypt the request to get the content?
But then normal proxy servers obviously can proxy HTTPS, so I guess perhaps it will work because it will just copy across the encrypted content?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果 IP 地址不同,则可能不会。您可以尝试在 HTTP GET 请求中实现 X-Forwarded-For,但我怀疑这是否可行。
Probably not if the IP address is different. You could try implementing the X-Forwarded-For in the HTTP GET request, but I doubt that would work.