use of org.eclipse.jetty.websocket.jsr356.EchoHandler in project jetty.project by eclipse.
the class MisbehavingClassTest method startServer.
@SuppressWarnings("Duplicates")
@BeforeClass
public static void startServer() throws Exception {
server = new Server();
ServerConnector connector = new ServerConnector(server);
server.addConnector(connector);
handler = new EchoHandler();
ContextHandler context = new ContextHandler();
context.setContextPath("/");
context.setHandler(handler);
server.setHandler(context);
// Start Server
server.start();
String host = connector.getHost();
if (host == null) {
host = "localhost";
}
int port = connector.getLocalPort();
serverUri = new URI(String.format("ws://%s:%d/", host, port));
}
use of org.eclipse.jetty.websocket.jsr356.EchoHandler in project jetty.project by eclipse.
the class EndpointEchoTest method startServer.
@BeforeClass
public static void startServer() throws Exception {
server = new Server();
ServerConnector connector = new ServerConnector(server);
server.addConnector(connector);
handler = new EchoHandler();
ContextHandler context = new ContextHandler();
context.setContextPath("/");
context.setHandler(handler);
server.setHandler(context);
// Start Server
server.start();
String host = connector.getHost();
if (host == null) {
host = "localhost";
}
int port = connector.getLocalPort();
serverUri = new URI(String.format("ws://%s:%d/", host, port));
}
Aggregations