https - https的socat端口转发

标签 https forwarding socat

我可以像这样使用 socat 进行端口转发:

socat TCP4-LISTEN:8080 TCP4:123.456.789.12:80

在这种情况下,它完美地工作:所有 httplocalhost:8080 的请求都将被重定向到 123.456.789.12:80

但是如何将这种转发用于 https -requests?

更新: 我需要 Firefox 和远程服务器之间的单个 socat 进程。 socat 只是一个转发器(代理重定向器),仅此而已。像这样的东西:
Firefox -> socat -> server
       ------------>
           https

最佳答案

通常 https 服务器在端口 443 上运行,所以这可能是您的问题?

尝试使用 https 浏览 socat 到 google.com 可以正常工作,尽管有 SSL 证书警告:

socat TCP-LISTEN:8080,fork,reuseaddr TCP:google.com:443

(使用 forkreuseaddr 允许多个连接和快速 ip:port 重用,但使用 beaware of the caveats )。

现在您可以从浏览器访问 google 上的 https,只需转到 https://localhost:8080 .

关于https - https的socat端口转发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34791674/

相关文章:

linux - 使用 SOCAT 记录在端口上收到的消息

wcf - 客户端身份验证方案 'Anonymous' 禁止 HTTP 请求

PHP - Symfony2 功能测试 HTTPS 路由

c++ - 最小和完美转发

zend-framework - 禅德 : Redirect to page after log in with a URL from email

linux - socat Linux 的 C 库

http - 使用 gzip/deflate 压缩的简单 HTTP 请求

android - SSL 握手中止 - 确切原因是什么?

Javascript动画gif转发

udp - 在 Vagrant 和 VirtualBox Env​​ 中使用 `socat` 进行多播