Socket request returning 101

UI Components for JSF
Post Reply
kuburoman
Posts: 3
Joined: 20 May 2012, 12:43

08 Apr 2015, 00:05

I am trying to set up <p:socket> but i always get 101 Switching protocol response. No error or information in logs from server.

Project SDK: 1.8.0_31
Primefaces: 5.1
atmosphere-runtime: 2.2.6
Tomcat: 8.0.20
Ide: IntelliJ IDEA 14.0.3
Browser: Chrome Version 41.0.2272.118 m

Here is response:

Code: Select all

Request URL:ws://localhost:8081/primepush/pokus?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.2.4-javascript&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&X-atmo-protocol=true
Request Method:GET
Status Code:101 Switching Protocols
Response Headers
view source
Connection:upgrade
Date:Tue, 07 Apr 2015 21:56:14 GMT
Sec-WebSocket-Accept:+8EyQc/PbZ5Hz27YdgdsJSzNymY=
Sec-WebSocket-Extensions:permessage-deflate;client_max_window_bits=15
Server:Apache-Coyote/1.1
Upgrade:websocket
Request Headers
view source
Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-GB,en;q=0.8,cs;q=0.6
Cache-Control:no-cache
Connection:Upgrade
Cookie:JSESSIONID=CC56F69C5F2D3E744CC41AF36C198A37
Host:localhost:8081
Origin:http://localhost:8081
Pragma:no-cache
Sec-WebSocket-Extensions:permessage-deflate; client_max_window_bits
Sec-WebSocket-Key:4LF/d17QW3fOC3rTQ8mKIg==
Sec-WebSocket-Version:13
Upgrade:websocket
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36
Query String Parameters
view source
view URL encoded
X-Atmosphere-tracking-id:0
X-Atmosphere-Framework:2.2.4-javascript
X-Atmosphere-Transport:websocket
X-Atmosphere-TrackMessageSize:true
X-atmo-protocol:true
Page:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
    <title>Login Page</title>
</h:head>
<h:body>

    <h:form>
        <p:growl widgetVar="growl" showDetail="true"/>

        <p:socket onMessage="handleMessage" channel="/pokus"/>

        <script type="text/javascript">
            function handleMessage(facesmessage) {
                facesmessage.severity = 'info';
                console.log("try")
                growl.show([facesmessage]);
            }
        </script>
    </h:form>
</h:body>
</html>

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

09 Apr 2015, 13:14

getting a 101 is normal. I get that to on the primefaces showcase

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: XRumer23dak and 44 guests