在LittleProxy中,如何设置代理ip和端口?他们网站上的样本:
HttpProxyServer server = DefaultHttpProxyServer.bootstrap() .withPort(8080) 。开始();
答案 0 :(得分:2)
这是使用johnstlr的评论派生的测试代码。
ChainedProxyAdapter adapter = new ChainedProxyAdapter() {
@Override
public InetSocketAddress getChainedProxyAddress() {
return new InetSocketAddress("your.proxy.address", 1234);
}
};
ChainedProxyManager manager = new ChainedProxyManager() {
@Override
public void lookupChainedProxies(HttpRequest httpRequest, Queue<ChainedProxy> chainedProxies) {
chainedProxies.add(adapter);
}
};
HttpProxyServer server = DefaultHttpProxyServer.bootstrap().withChainProxyManager(manager).withPort(8080).start();
答案 1 :(得分:0)
查看源代码,您应该可以执行类似
的操作HttpProxyServer server = DefaultHttpProxyServer.bootstrap()
.withAddress(new InetSocketAddress("127.0.0.1", 8080)).start();