// Fail if host address is a public IP but only on-site networking is allowed.
if (onsiteonly) {
if (hostAddress == null || (!hostAddress.isLoopbackAddress()
&& !hostAddress.isLinkLocalAddress()
&& !hostAddress.isSiteLocalAddress())) {
throw new ElasticsearchException("Bind host " + bindHost
+ (hostAddress != null ? "(address " + hostAddress + ") " : "")
+ "is not on-site and not permitted by default. Check 'websocket.onsiteonly' setting in configuration.");
}
}