Package org.eclipse.jetty.websocket

Examples of org.eclipse.jetty.websocket.WebSocketHandler


      connector.setReuseAddress(false);
      connector.setSoLingerTime(0);
 
      Server server = new Server();
      server.addConnector(connector);
      server.setHandler(new WebSocketHandler()
      {
        @Override
        public WebSocket doWebSocketConnect(HttpServletRequest arg0, String arg1)
        {
          return new WebSocket() 
View Full Code Here


    public WebsocketServer(int port) throws URISyntaxException {
        SelectChannelConnector connector = new SelectChannelConnector();
        connector.setPort(port);
        addConnector(connector);

        setHandler(new WebSocketHandler() {

            @Override
            public WebSocket doWebSocketConnect(HttpServletRequest request, String protocol) {
                return new TuscanyWebsocket(dispatcher);
            }
View Full Code Here

            connector.setHost(bindingAddress.trim());
        }
        connector.setPort(_port.getPort());
        _server.addConnector(connector);

        WebSocketHandler wshandler = new WebSocketHandler()
        {
            @Override
            public WebSocket doWebSocketConnect(final HttpServletRequest request, final String protocol)
            {
View Full Code Here

        }

        connector.setPort(_port.getPort());
        _server.addConnector(connector);

        WebSocketHandler wshandler = new WebSocketHandler()
        {
            @Override
            public WebSocket doWebSocketConnect(final HttpServletRequest request, final String protocol)
            {
View Full Code Here

        }

        connector.setPort(_port.getPort());
        _server.addConnector(connector);

        WebSocketHandler wshandler = new WebSocketHandler()
        {
            @Override
            public WebSocket doWebSocketConnect(final HttpServletRequest request, final String protocol)
            {

                Principal principal = null;
                if(Collections.list(request.getAttributeNames()).contains(X509_CERTIFICATES))
                {
                    X509Certificate[] certificates =
                            (X509Certificate[]) request.getAttribute(X509_CERTIFICATES);
                    if(certificates != null && certificates.length != 0)
                    {

                        principal = certificates[0].getSubjectDN();
                    }
                }

                SocketAddress remoteAddress = new InetSocketAddress(request.getRemoteHost(), request.getRemotePort());
                SocketAddress localAddress = new InetSocketAddress(request.getLocalName(), request.getLocalPort());
                return AMQP_WEBSOCKET_SUBPROTOCOL.equals(protocol) ? new AmqpWebSocket(_transport, localAddress, remoteAddress, principal) : null;
            }
        };

        _server.setHandler(wshandler);
        _server.setSendServerVersion(false);
        wshandler.setHandler(new AbstractHandler()
        {
            @Override
            public void handle(final String target,
                               final Request baseRequest,
                               final HttpServletRequest request,
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.websocket.WebSocketHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.