bindAddress property
Bind address for the server.
Can be a String containing a hostname or IP address, or one of these
values from the InternetAddress
class: InternetAddress.loopbackIPv4
,
InternetAddress.loopbackIPv6
, InternetAddress.anyIPv4
or
InternetAddress.anyIPv6
.
The default value is loopbackIPv4, which means it only listens on the IPv4 loopback address of 127.0.0.1. This option is usually used when the service is run behind a reverse proxy server (e.g. Apache or Nginx). The server can only be contacted over IPv4 from the same machine.
If deployed without a reverse proxy, this value needs to be change otherwise clients external to the machine will not be allowed to connect to the Web server.
If it is set to InternetAddress.anyIPv6
, it listens on any IPv4 or
IPv6 address (including the loop-back addresses),
unless v6Only is set to true (in which case it only listens on any IPv6
address and the IPv6 loopback address).
Implementation
InternetAddress bindAddress = InternetAddress.loopbackIPv4