Java Socks5 外部应用程序

发布于 2024-09-18 14:57:22 字数 117 浏览 5 评论 0原文

我已经在我的 java 应用程序中连接到了ocks5服务器,现在我想启动一个外部应用程序并让它的所有连接都通过socks5服务器运行。外部应用程序本身不支持socks5。

任何输入都会很棒,在这里挠头..

I have connected to a socks5 server in my java application, and now I want to launch an external application and have all of its connections run through the socks5 server. The external application itself doesn't support socks5.

Any input would be great, scratching my head here..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

乄_柒ぐ汐 2024-09-25 14:57:22

我知道如何做到这一点的第二个技巧是替换标准运行时库或类似的技巧来拦截操作系统网络调用或在内核中设置一组精细调整的防火墙规则。

这两种技术都是特定于操作系统的,并且无法使用 java 来实现。

最好的选择是运行现有的socks5包装器并让该程序启动外部应用程序,例如socksify

我对这种方法有不同的经验,有些应用程序可以工作,有些则不能,并且从未发现其中有任何逻辑。

YMMV

另一种方法是在 Java 应用程序中运行 tcpproxy(例如使用 Apache MINA 等)并让应用程序连接到本地主机上的代理端口。同样,这仅适用于某些服务。

The 2 trick I know how to do that are to replace the standard runtime library or a similar trick to intercept the OS networking calls or to setup a set of finely tuned firewall rules in the kernel.

Both of these techniques are very OS specific and have no way to da that using java.

Your best bet would be to run an existing socks5 wrapper and let that program start the external application like socksify.

I have had mixed experience with this approach, some applications work, others do not, and never found any logic in it.

YMMV

Another approach is to play a tcpproxy in the Java application (e.g. using the Apache MINA stuff) and have the application connect to your proxy port on localhost. Again this will only work for certain services.

清秋悲枫 2024-09-25 14:57:22

如果外部应用程序是用 Java 编写的,那么它就支持 SOCKS。只需使用 -DsocksProxyHost=host 和 -DsocksProxyPort=port 运行它。参见[1]。

[1]:http://download.oracle。 com/javase/6/docs/technotes/guides/net/properties.html“网络属性”。

If the external application is written in Java it does support SOCKS. Just run it with -DsocksProxyHost=host and -DsocksProxyPort=port. See [1].

[1]: http://download.oracle.com/javase/6/docs/technotes/guides/net/properties.html "Networking Properties".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文