I am using a lush client in Java 8 with RESTEasy 3.0.10. As an implementation of the funnel windows 7 64-bit uses RESTEasy in place of the Apache httpclient 4.2.6.
I have to manually specify a web proxy for the httpclient, so if I configure a in my code ResteasyClientBuilder
use a specially configured ApacheHttpClient4Engine
, use my RESTEasy client connection correctly proxy.
My problem is that I would use the java.net.useSystemProxies
system property so that my Java program which is configured in the Proxy Windows Internet Options, will use , So that my Java program will work seamlessly with other programs and it is not necessary that it can be specifically configured. It works fine for connections using Java's native HTTP connection. But the RESTEasy / Apache httpclient apparently opens a straightforward socket and makes its HTTP communication at a low level.
When I tell Java to use the system proxy, Java actually routs the httpclient connection to the proxy. But for some reason, the httpclient thinks this is a SOCKS proxy --- or some other --- the request bar is talking to:
java.net.SocketException: SOCKS proxy can not connect: connection timed out are: java.net.Socket.connect (Socket.java:589) org.apache.http.conn.scheme.PlainSocketFactory.connectSocket (at JavaknetkSocksSocketImplkconnect ( SocksSocketImpl.java:429) connected on Org.apache.http.impl.conn.ManagedClientConnectionImpl.open (org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection PlainSocketFactory.java:127) to (DefaultClientConnectionOperator.java:180) (ManagedClientConnectionImpl.java:294) .apache.http.impl.client.DefaultRequestDirector.tryConnect org.ap On ache.http.impl.client.DefaultRequestDirector.execute (DefaultRequestDirector.java:479) (DefaultRequestDirector.java:643) on Org.apache.http.impl.client.AbstractHttpClient.exec on org.apache.http.impl.client .AbstractHttpClient.execute (AbstractHttpClient.java:906). Ort.exe (AbstractHttpClient.java:805) org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke at (ApacheHttpClient4Engine.java:283) at org.jboss. Resteasy.client.jaxrs.internal.ClientInvocation.invoke (Client Invocation. Java: 407) at org.jboss.resteasy.client.jaxrs.internal.ClientInvocationBuilder.get (ClientInvocationBuilder.java:159) having
close SOCKS routing another default proxy selector And in reality this same system prevents the httpclient socket from being routed to the proxy --- but then the HTTP connection completely overrides the proxy, which aims to ignore.
I'm guessing here that the httpclient only asks for one socket, and the Java system looks at the proxy and assumes that the socket connection is for a sock proxy, even if I guess If the Java Sockets have been passed in the Web Proxy, then the httpclient will not know anything about it and as a result the correct proxy format of the HTTP request has not been seen. Or will you see in any manner that java.net.useSystemProxies
is turned on, and will change its request? But how will it know if the system proxy is actually in effect or not?
So I'm completely at a standstill. If I java.net.useSystemProxies
on thee, and turn on the normal HTTP requests in Java, so they use the system configured web proxy I I made system-configured web proxy How can I tell RESTEasy / httpclient to use?
No comments:
Post a Comment