Package org.jboss.netty.handler.codec.http.websocketx

Examples of org.jboss.netty.handler.codec.http.websocketx.WebSocketServerHandshakerFactory


            sendHttpResponse(ctx, req, new DefaultHttpResponse(HTTP_1_1, FORBIDDEN));
            return;
        }

        // Handshake
        WebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory(
                this.getWebSocketLocation(req), "v10.stomp,v11.stomp", false);
        this.handshaker = wsFactory.newHandshaker(req);
        if (this.handshaker == null) {
            wsFactory.sendUnsupportedWebSocketVersionResponse(ctx.getChannel());
        } else {
            ChannelFuture handshake = this.handshaker.handshake(ctx.getChannel(), req);
            handshake.addListener(new ChannelFutureListener() {

                @Override
View Full Code Here


      if(factory == null) {
        ctx.getChannel().close();
        return;
      }
     
      WebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory(
                  ERWOAdaptorUtilities.getWebSocketLocation(req), null, false);
      handshaker = wsFactory.newHandshaker(req);
     
      Channel socketChannel = ctx.getChannel();
      if(handshaker == null) {
        wsFactory.sendUnsupportedWebSocketVersionResponse(socketChannel);
      } else {
        ChannelFuture future = handshaker.handshake(socketChannel, req);
        //TODO tie this to the channel future result?
        //Create a WebSocket instance to handle frames
        WebSocket socket = factory.create(socketChannel, req);
View Full Code Here

         loadScriptToResponse(req, res);
         sendHttpResponse(ctx, req, res);
         return;
      } else {
          // Handshake
          WebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory(
                  getWebSocketLocation(req), null, false);
          handshaker = wsFactory.newHandshaker(req);
          // Check if we can find the right handshaker for the requested version
          if (handshaker == null) {
              wsFactory.sendUnsupportedWebSocketVersionResponse(ctx.getChannel());
          } else {
              // fuehre den Handshake
              handshaker.handshake(ctx.getChannel(), req).addListener(new ChannelFutureListener() {
                  @Override
                  public void operationComplete(ChannelFuture future) throws Exception {
View Full Code Here

        String upgradeHeader = req.getHeader("Upgrade");
        if(upgradeHeader != null && upgradeHeader.toUpperCase().equals("WEBSOCKET")){
      Logger.getLogger(WebsockifyProxyHandler.class.getName()).fine("Websocket request from " + e.getRemoteAddress() + ".");
          // Handshake
          WebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory(
                  this.getWebSocketLocation(req), "base64", false);
          this.handshaker = wsFactory.newHandshaker(req);
          if (this.handshaker == null) {
              wsFactory.sendUnsupportedWebSocketVersionResponse(ctx.getChannel());
          } else {
            // deal with a bug in the flash websocket emulation
            // it specifies WebSocket-Protocol when it seems it should specify Sec-WebSocket-Protocol
            String protocol = req.getHeader("WebSocket-Protocol");
            String secProtocol = req.getHeader("Sec-WebSocket-Protocol");
View Full Code Here

TOP

Related Classes of org.jboss.netty.handler.codec.http.websocketx.WebSocketServerHandshakerFactory

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.