Skip to content

Commit

Permalink
-Uaca is now listenting only on localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
pruttkay-nedecky committed May 27, 2014
1 parent a5c0122 commit 2fe6c83
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.gratex.perconik.useractivity.app.watchers;

import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.glassfish.jersey.server.ServerProperties;
Expand Down Expand Up @@ -45,7 +47,14 @@ public void start() throws Exception {
throw new IllegalStateException("Already started");
}

server = new Server(port);
server = new Server();

//listen only on localhost - http://stackoverflow.com/a/1955591
ServerConnector connector=new ServerConnector(server);
connector.setPort(port);
connector.setHost("localhost");
server.setConnectors(new Connector[]{connector});

servletContextHandler = new ServletContextHandler(server, "/",
ServletContextHandler.SESSIONS);
servletContextHandler.addServlet(servletHolder, "/*");
Expand Down

0 comments on commit 2fe6c83

Please sign in to comment.