|
|
@ -45,6 +45,7 @@ import net.yacy.cora.protocol.HeaderFramework;
|
|
|
|
import net.yacy.cora.protocol.RequestHeader;
|
|
|
|
import net.yacy.cora.protocol.RequestHeader;
|
|
|
|
import net.yacy.cora.protocol.ResponseHeader;
|
|
|
|
import net.yacy.cora.protocol.ResponseHeader;
|
|
|
|
import net.yacy.cora.protocol.http.HTTPClient;
|
|
|
|
import net.yacy.cora.protocol.http.HTTPClient;
|
|
|
|
|
|
|
|
import net.yacy.cora.util.ConcurrentLog;
|
|
|
|
import net.yacy.document.TextParser;
|
|
|
|
import net.yacy.document.TextParser;
|
|
|
|
import net.yacy.crawler.data.Cache;
|
|
|
|
import net.yacy.crawler.data.Cache;
|
|
|
|
import net.yacy.crawler.retrieval.Response;
|
|
|
|
import net.yacy.crawler.retrieval.Response;
|
|
|
@ -91,7 +92,7 @@ public class ProxyHandler extends AbstractRemoteHandler implements Handler {
|
|
|
|
public void handleRemote(String target, Request baseRequest, HttpServletRequest request,
|
|
|
|
public void handleRemote(String target, Request baseRequest, HttpServletRequest request,
|
|
|
|
HttpServletResponse response) throws IOException, ServletException {
|
|
|
|
HttpServletResponse response) throws IOException, ServletException {
|
|
|
|
|
|
|
|
|
|
|
|
if (request.getMethod().equals(HeaderFramework.METHOD_CONNECT)) {
|
|
|
|
if (request.getMethod().equalsIgnoreCase(HeaderFramework.METHOD_CONNECT)) {
|
|
|
|
handleConnect(request, response);
|
|
|
|
handleConnect(request, response);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -100,7 +101,7 @@ public class ProxyHandler extends AbstractRemoteHandler implements Handler {
|
|
|
|
setProxyHeaderForClient(request, proxyHeaders);
|
|
|
|
setProxyHeaderForClient(request, proxyHeaders);
|
|
|
|
|
|
|
|
|
|
|
|
final HTTPClient client = new HTTPClient(ClientIdentification.yacyProxyAgent);
|
|
|
|
final HTTPClient client = new HTTPClient(ClientIdentification.yacyProxyAgent);
|
|
|
|
int timeout = 60000;
|
|
|
|
int timeout = 10000;
|
|
|
|
client.setTimout(timeout);
|
|
|
|
client.setTimout(timeout);
|
|
|
|
client.setHeader(proxyHeaders.entrySet());
|
|
|
|
client.setHeader(proxyHeaders.entrySet());
|
|
|
|
client.setRedirecting(false);
|
|
|
|
client.setRedirecting(false);
|
|
|
|