Silvertunnel Netlib (https://silvertunnel.org/doc/netlib.html)을 사용하여 Tor 네트워크를 통해 Java 응용 프로그램 내에서 익명화 된 HTTP 요청을하려고합니다.Silvertunnel Netlib을 사용하여 Java : Tor HTTP 요청
다음java.io.IOException: Tor.connect: unable to connect to null:80 after 11 full retries with 5 sub retries
at org.silvertunnel.netlib.layer.tor.clientimpl.Tor.connect(Tor.java:281)
at org.silvertunnel.netlib.layer.tor.TorNetLayer.createNetSocket(TorNetLayer.java:113)
at org.silvertunnel.netlib.util.HttpUtil.get(HttpUtil.java:121)
at FlightBot.main(FlightBot.java:48)
가있다 : 나는 TCPIP를 통해 요청을 할 때하지만 TOR 설정을 사용할 때 작동하는 예제 코드를 사용하고 있는데, 그것은 (연결을 시도 약 10 분) 다음과 같은 예외로 종료 코드를 사용하고 있습니다 :
NetLayer lowerNetLayer = NetFactory.getInstance().getNetLayerById(NetLayerIDs.TOR);
// wait until TOR is ready (optional) - this is only relevant for anonymous communication:
lowerNetLayer.waitUntilReady();
// prepare parameters (http default port: 80)
TcpipNetAddress httpServerNetAddress = new TcpipNetAddress("httptest.silvertunnel.org", 80);
String pathOnHttpServer = "/httptest/bigtest.jsp?id=example";
long timeoutInMs = 5000;
// do the HTTP request and wait for the response
byte[] responseBody = HttpUtil.getInstance().get(lowerNetLayer, httpServerNetAddress, pathOnHttpServer, timeoutInMs);
// print out the response
System.out.println(new String(responseBody));
내가 잘못했거나 현재 사용할 수없는 Tor 네트워크입니까? 사용하는 경우
분명히하기 위해, 그것을 작동합니다 : 첫 번째 줄에NetLayer lowerNetLayer = NetFactory.getInstance().getNetLayerById(NetLayerIDs.TCPIP)
합니다.
정말 고마워요. Tor 네트워크를 사용하지 않고 애플리케이션을 구현했지만 나중에 프로젝트에서이를 염두에 두겠습니다. –
@HybridSystem 요청을 익명으로 만들기 위해 어떤 라이브러리를 사용 했습니까? –
TOR 네트워크 나 특정 라이브러리 대신 ProxyMesh에서 유료 프록시를 사용했습니다. –