如何在 C# 上通过 socks 打开 https 页面?

How I can open https pages via socks on c#?

我正在使用 c# 并构建了使用 socks5 服务器获取网页的 socks5 客户端。但是这些页面只在 80 端口(HTTP)上。我想打开 443 端口 (HTTPS) 上的页面。例如:https://google.com。如果我只是通过 443 上的 socks5 连接 -> google 服务器拒绝我。我该怎么做?

PS: 我的客户端通过套接字工作,也许我应该使用其他方式?

对不起我的英语。

非常感谢@jdweng。解决方案是:

我们可以使用 TcpClient 或 Sockets(无关紧要)连接到我们的 socks 服务器。例如:

create TcpClient using our socksIp/socksPort
get NetworkStream from our TcpClient.GetStream();

or use sockets

________
THEN:
________
send 0x05,0x01,0x00
receive 0x05, 0x00
send 0x05, 0x01, 0x00, 0x03, 0x0f, 0x77, 0x77, 0x77, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65 <- it's for www.example.com:443
receive 0x05, 0x00, 0x00, 0x01, etc
if we used sockets -> create NetworkStream from our socket
create SslStream from our NetworkStream
in SslStream - authenticate as client with www.example.com
send our request like a "GET / HTTP/1.1\r\nHost: www.example.com\r\nConnection: close\r\n\r\n"
receive while not eof
close stream/socket etc

利润:)