How can i select multiple network interface using apache httpclient 4.1.2

1.4k Views Asked by At

I have multiple network interface(Like WIFI,LAN,LTE dougle).I am sending http request using apache httpclient 4.1.2. I want to select the network interface during sending the http request. I can see the network interfaces using java.net.NetworkInterface class. Can anyone help me how can i do it using http client? I want to send one http request using one network interface and second http request using the other interface. Its like load balancing

1

There are 1 best solutions below

0
On BEST ANSWER

You can set the ConnRoutePNames.LOCAL_ADDRESS='http.route.local-address' parameter to the INetAddress of the desired interface. See section 2.4 of this doc for more information.