Hi, I don't see easy way to do it. URLConnection doesn't support setting network interface directly.
The option is to override AsyncHTTPConduit.setupConnection() method and set your interface address using RequestConfig.Builder.setLocalAddress() (http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/client/config/RequestConfig.Builder.html#setLocalAddress(java.net.InetAddress) ) After that, configure and use overriding conduit. Perhaps there is easier way to achieve this, but I am not aware about it. Regards, Andrei. > -----Original Message----- > From: jvh003 [mailto:[email protected]] > Sent: Dienstag, 28. Juni 2016 16:36 > To: [email protected] > Subject: Howto set local inet address for CXF client > > Hello, > I have a CXF client running on a Linux platform that has 2 network interfaces. > Currently my client requests are sent out on the 1st interface, but I need > them > to be sent out on the 2nd one. > How can I set the local address that the client will use when creating client > connections to the far end web-service? > > I was reading here > http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html > about now to change the connection timeout value. > I am looking for something similar to set the local InetAddress for the > client. > > Thanks > > > > -- > View this message in context: http://cxf.547215.n5.nabble.com/Howto-set- > local-inet-address-for-CXF-client-tp5769787.html > Sent from the cxf-user mailing list archive at Nabble.com.
