All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sirius.web.http.WebsocketDispatcher Maven / Gradle / Ivy

There is a newer version: 22.2.3
Show newest version
/*
 * Made with all the love in the world
 * by scireum in Remshalden, Germany
 *
 * Copyright by scireum GmbH
 * http://www.scireum.de - [email protected]
 */

package sirius.web.http;

import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.HttpRequest;

/**
 * Provides a way to support websockets for the built-in web server.
 * 

* Websocket support is done by creating a class implementing this interface. By placing an {@link * sirius.kernel.di.std.Register} annotation is is found by the {@link WebServerHandler} which then initiates the * websocket protocol for requests on the given uri. */ public interface WebsocketDispatcher { /** * Returns the URI which is used to determine if a request is eligble for upgrading to web sockets. * * @return the uri which is used to start websockets */ String getWebsocketUri(); /** * Creates a new session for a given channel (context) and request. * * @param ctx the channel which was used to initialize a websocket * @param req the request which was made before upgrading to websockets * @return a new session handling incoming and outgoing frames */ WebsocketSession createSession(ChannelHandlerContext ctx, HttpRequest req); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy