'Configure embedded tomcat server to only listen to localhost connections
I am running an application with an embedded tomcat server which by default listens to any connections (binds to 0.0.0.0). I am trying to bind the server to listen to localhost connections only. How can I achieve this within my launcher class? (without using any special configuration files)
tomcat.setPort(8080);
tomcat.setHostname("localhost");
...(adding webapp and servlet)...
tomcat.start();
tomcat.getServer().await();
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
