B4J Question Could Jetty listen on an explicit ip?

dar2o3

Active Member
Licensed User
Longtime User
the network card is just the way to get to a place, imagine a house to which one can go in two different directions, no matter which way you choose, you will reach the same house (there is only one home)

I mean if you create a service on port 80 (for example) you can reach that port (if you have 2 network cards) for 2 different ip but the service (80) will be the same.

You can configure the router, to service the port (80) in a particular IP address.
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
Thanks for your answers... I found this about jetty under "Configuring Connectors":

http://www.eclipse.org/jetty/documentation/current/quickstart-config-what.html

Host
You can configure a host either as a host name or IP address to identify a specific network interface on which to listen. If not set, or set to the value of 0.0.0.0, the connector listens on all local interfaces. The XML Property element is used to look up the host value from the jetty.host property.

I ask me, if it will be possible in the future. If yes, I think it will be worthwihile to split the admin and user server in two separate apps...
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Download the attached library (v2.52) and copy it to the internal libraries folder.

It allows you to set the host property with JavaObject:
B4X:
Dim jo As JavaObject = srvr
jo.SetField("host", "ip.address")
srvr.Start
 

Attachments

  • jServer.zip
    43.2 KB · Views: 326
Upvote 0
Top