Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

两层TCP代理,想要拦截本地服务通过TCP访问的流量并代理转发,能够实现吗? #537

Open
DeviZhao opened this issue Jul 13, 2023 · 1 comment

Comments

@DeviZhao
Copy link

目标效果:
本地服务上启动一个Goproxy,另一台服务器上也启动一台,构成二级代理;
本地服务通过不固定的IP和指定端口进行tcp访问时,流量被本地服务器的Goproxy拦截,然后转发至另外一台服务的Goproxy,并由另外一台Goproxy完成对目标IP的TCP连接;

@lowzj
Copy link

lowzj commented Sep 19, 2023

redsocks + iptables 可以完成你的本地goproxy的功能

  1. iptables将本地所有非内部流量转发到redsocks
  2. redsocks将流量转发至另一个GoProxy服务

这里有个demo: https://github.com/lowzj/devcontiner-socks

这里redsocks应该可以也用GoProxy替换,未测试。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants