gpt4 book ai didi

c# - .NET HttpListener - 设置浏览器代理时监听 "https://*.8080"时没有流量?

转载 作者:太空狗 更新时间:2023-10-30 01:11:25 31 4
gpt4 key购买 nike

背景 - 我可以让 HttpListener 为 HTTP 流量正常工作。但是,我在 HTTPS 流量方面遇到了问题。

问题:如何更改下面的代码,以便我的 HttpListener 实际接收对“https”URL 的浏览器请求?

注意 - 目前 firefox 的代理设置设置为“localhost:8080”,当我在端口 8080(“https://*:8080/”)上监听流量时,我在 firefox 中输入一个 HTTPS url,我没有收到任何流量? (当我只听 http 并输入正常的 http url 时,它工作正常)

  _httpListener = new HttpListener();
_httpListener.Prefixes.Add("https://*:8080/");
_httpListener.Start();

谢谢

最佳答案

来自 MSDN

If you create an HttpListener using https, you must select a Server Certificate for that listener. Otherwise, an HttpWebRequest query of this HttpListener will fail with an unexpected close of the connection.

You can configure Server Certificates and other listener options by using HttpCfg.exe. See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/http/http/httpcfg_exe.asp for more details. The executable is shipped with Windows Server 2003, or can be built from source code available in the Platform SDK.

虽然不确定 100%...

关于c# - .NET HttpListener - 设置浏览器代理时监听 "https://*.8080"时没有流量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2641891/

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