org.webbitserver.handler.HttpToWebSocketHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of webbit Show documentation
Show all versions of webbit Show documentation
A Java event based WebSocket and HTTP server
package org.webbitserver.handler;
import org.webbitserver.HttpControl;
import org.webbitserver.HttpHandler;
import org.webbitserver.HttpRequest;
import org.webbitserver.HttpResponse;
import org.webbitserver.WebSocketHandler;
public class HttpToWebSocketHandler implements HttpHandler {
private final WebSocketHandler handler;
public HttpToWebSocketHandler(WebSocketHandler handler) {
this.handler = handler;
}
@Override
public void handleHttpRequest(HttpRequest request, HttpResponse response, HttpControl control) throws Exception {
control.upgradeToWebSocketConnection(handler);
}
}