diff --git a/src/main/java/org/apache/hadoop/hbase/rest/Main.java b/src/main/java/org/apache/hadoop/hbase/rest/Main.java index 2c1e12ae9db..7e2681bb933 100644 --- a/src/main/java/org/apache/hadoop/hbase/rest/Main.java +++ b/src/main/java/org/apache/hadoop/hbase/rest/Main.java @@ -39,7 +39,9 @@ import org.apache.hadoop.net.DNS; import java.util.List; import java.util.ArrayList; +import org.mortbay.jetty.Connector; import org.mortbay.jetty.Server; +import org.mortbay.jetty.nio.SelectChannelConnector; import org.mortbay.jetty.servlet.Context; import org.mortbay.jetty.servlet.ServletHolder; @@ -129,9 +131,14 @@ public class Main implements Constants { // set up Jetty and run the embedded server - int port = servlet.getConfiguration().getInt("hbase.rest.port", 8080); + Server server = new Server(); + + Connector connector = new SelectChannelConnector(); + connector.setPort(servlet.getConfiguration().getInt("hbase.rest.port", 8080)); + connector.setHost(servlet.getConfiguration().get("hbase.rest.host", "0.0.0.0")); + + server.addConnector(connector); - Server server = new Server(port); server.setSendServerVersion(false); server.setSendDateHeader(false); server.setStopAtShutdown(true);