【发布时间】:2013-03-07 11:14:20
【问题描述】:
是否可以使用此处描述的 Netty: http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html
也许有一些选项,例如:
System.getProperties().put("socksProxySet","true");
System.getProperties().put("socksProxyHost","127.0.0.1");
System.getProperties().put("socksProxyPort","1080");
我试过了,但是 netty 不接受属性,也不通过 socks 代理代理请求。
ChannelFuture future =
bootstrap.connect(
new InetSocketAddress(uri.getHost(), uri.getPort()));
我的 netty 客户端通过 websockets 连接到 netty 服务器。
Java NIO 不支持代理。 Netty 基于 Java NIO。我只是希望这种可能性存在/可以添加到netty。
谢谢!
【问题讨论】:
-
SOCKS 代理服务器是否已配置?或者您想使用 netty-server 作为 SOCKS 服务器?
-
不,socks 服务器已经在运行——它根本不是 netty。我不想使用 netty sever 作为 socks 服务器。我想通过 soks 代理使用我的 netty 服务器。我发现java.nio根本不支持代理模式——而netty是基于java.nio的。但也许有些东西改变了......