Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Binding Jetty HttpClient to Network Interface Card

Hi,

Am 29.09.2016 um 22:36 schrieb davidjesse091@xxxxxxx:
The setBindAddress method takes in an ipaddress or hostname and a port
 number, I don't understand what the port number is for.

To specify where the client should listen for incoming requests.

 I used the binding functionality of Apache HttpComponents and I
 had to provide it with a InetAddress. But I am straggling to find
 a way to make it work for Jetty

Find a free port and use it for calling that method, e.g.

ServerSocket ss = new ServerSocket(0, 1, getByName("192.168.1.1"));
SocketAddress sa = ss.getLocalSocketAddress();
ss.close();
jettyClient.setBindAddress(sa);

Since I don't use that kind of functionality (I'm developing on
the server side), this is just an educated guess.


Cheers, Lothar


Back to the top