javajettyjetty-9jetty-httpclient

Binding Jetty HttpClient to Network Interface Card


I will be using Jetty HttpClient on machines with two Network Interface Cards, I want the ability to force (bind) Jetty HttpClient to one of the NICs, would this be possible with Jetty HttpClient?


Solution

  • Use HttpClient.setBindAddress(java.net.SocketAddress) to set the address of the NIC you want to bind the output requests against.