[JIRA] (COMETD-329) websocket handshake does not carry data

25 views
Skip to first unread message

Saitz Peter (Created) (JIRA)

unread,
Jan 24, 2012, 3:04:25 AM1/24/12
to comet...@googlegroups.com
websocket handshake does not carry data
---------------------------------------

Key: COMETD-329
URL: http://bugs.cometd.org/browse/COMETD-329
Project: CometD
Issue Type: Bug
Components: javascript-common, javascript-dojo
Affects Versions: 2.4.0.RC3
Reporter: Saitz Peter


May be I am misunderstanding how websocket handshake is handled, but websocket call "101 Switching Protocols" does not carry the data when called as:

dojox.cometd.handshake({ext: {authentication: {ic: icdata, auth: authdata, user: userdata}}});

Server refuses connection (handshake denied) and client goes into reconnecting loop.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: http://bugs.cometd.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Simone Bordet (Resolved) (JIRA)

unread,
Jan 24, 2012, 3:55:25 AM1/24/12
to comet...@googlegroups.com

[ http://bugs.cometd.org/browse/COMETD-329?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simone Bordet resolved COMETD-329.
----------------------------------

Assignee: Simone Bordet
Fix Version/s: 2.4.0
Resolution: Not a Bug

The WebSocket handshake (also called WebSocket upgrade) is different from the Bayeux handshake.

Using {{dojox.cometd.handshake({...})}} performs a Bayeux handshake, which happens _after_ the WebSocket upgrade.

The flow is:

# WebSocket upgrade request (HTTP GET request)
# WebSocket upgrade response (HTTP response, 101 Switching Protocols)
# WebSocket message containing Bayeux handshake request
# WebSocket message containing Bayeux handshake response

I am not sure what you're trying to achieve, but authentication on the WebSocket upgrade must be done using the usual HTTP facilities, not using Bayeux.
Note that you would have the same problem without WebSocket, if you implemented HTTP authentication.

Having said that, I am not sure what is the support of browsers for HTTP authentication on a WebSocket upgrade, so this may still be unexplored territory.



> websocket handshake does not carry data
> ---------------------------------------
>
> Key: COMETD-329
> URL: http://bugs.cometd.org/browse/COMETD-329
> Project: CometD
> Issue Type: Bug
> Components: javascript-common, javascript-dojo
> Affects Versions: 2.4.0.RC3
> Reporter: Saitz Peter

> Assignee: Simone Bordet
> Fix For: 2.4.0

Saitz Peter (Commented) (JIRA)

unread,
Jan 24, 2012, 4:12:25 AM1/24/12
to comet...@googlegroups.com

[ http://bugs.cometd.org/browse/COMETD-329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10813#comment-10813 ]

Saitz Peter commented on COMETD-329:
------------------------------------

I am not performing http authentication. I am attaching data into ext field of handshake, server takes a look at it for authentication, if data is correct, then handshake can return success, else it returns denied.

Steps 1,2: The websocket upgrade HTTP get request received 101 Switching Protocols

Step 3. ext field and its data was NOT sent to the server


dojox.cometd.handshake({ext: {authentication: {ic: icdata, auth: authdata, user: userdata}}});

So, server responded with handshake_denied, then client went into reconnect attempts loop (I think client should stop if handshake was denied)

So my problems are:
1. there is not data attached to handshake.
2. if server responds with handshake_denied, client should not try to reconnect in loop.



> websocket handshake does not carry data
> ---------------------------------------
>
> Key: COMETD-329
> URL: http://bugs.cometd.org/browse/COMETD-329
> Project: CometD
> Issue Type: Bug
> Components: javascript-common, javascript-dojo
> Affects Versions: 2.4.0.RC3
> Reporter: Saitz Peter

> Assignee: Simone Bordet
> Fix For: 2.4.0
>
>

Simone Bordet (Reopened) (JIRA)

unread,
Jan 24, 2012, 10:36:25 AM1/24/12
to comet...@googlegroups.com

[ http://bugs.cometd.org/browse/COMETD-329?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simone Bordet reopened COMETD-329:
----------------------------------


The problem was identified as a {{Connection: close}} header on the WebSocket upgrade response.

This of course is a big problem for WebSocket because it does not allow any WebSocket message to flow, but it continuously performs WebSocket upgrades without being able to actually send WebSocket messages.

Under investigation if this is due to the HaProxy load balancer.



> websocket handshake does not carry data
> ---------------------------------------
>
> Key: COMETD-329
> URL: http://bugs.cometd.org/browse/COMETD-329
> Project: CometD
> Issue Type: Bug
> Components: javascript-common, javascript-dojo
> Affects Versions: 2.4.0.RC3
> Reporter: Saitz Peter

> Assignee: Simone Bordet
> Fix For: 2.4.0
>
>

Saitz Peter (Commented) (JIRA)

unread,
Jan 24, 2012, 11:19:25 PM1/24/12
to comet...@googlegroups.com

[ http://bugs.cometd.org/browse/COMETD-329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10818#comment-10818 ]

Saitz Peter commented on COMETD-329:
------------------------------------

In any case, client should probably stop performing upgrade calls, if Upgrade carries "close" as well. "Close" should tell client to stop attempting to connect.



> websocket handshake does not carry data
> ---------------------------------------
>
> Key: COMETD-329
> URL: http://bugs.cometd.org/browse/COMETD-329
> Project: CometD
> Issue Type: Bug
> Components: javascript-common, javascript-dojo
> Affects Versions: 2.4.0.RC3
> Reporter: Saitz Peter

> Assignee: Simone Bordet
> Fix For: 2.4.0
>
>

Simone Bordet (Commented) (JIRA)

unread,
Apr 11, 2012, 10:10:25 AM4/11/12
to comet...@googlegroups.com

[ http://bugs.cometd.org/browse/COMETD-329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10858#comment-10858 ]

Simone Bordet commented on COMETD-329:
--------------------------------------

Peter, do you have updates on this issue ?



> websocket handshake does not carry data
> ---------------------------------------
>
> Key: COMETD-329
> URL: http://bugs.cometd.org/browse/COMETD-329
> Project: CometD
> Issue Type: Bug
> Components: javascript-common, javascript-dojo
> Affects Versions: 2.4.0.RC3
> Reporter: Saitz Peter

> Assignee: Simone Bordet
> Priority: Minor

Saitz Peter (Commented) (JIRA)

unread,
Apr 11, 2012, 4:00:25 PM4/11/12
to comet...@googlegroups.com

[ http://bugs.cometd.org/browse/COMETD-329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10861#comment-10861 ]

Saitz Peter commented on COMETD-329:
------------------------------------

Unfortunately no, I just did not have time to look more into it so far.



> websocket handshake does not carry data
> ---------------------------------------
>
> Key: COMETD-329
> URL: http://bugs.cometd.org/browse/COMETD-329
> Project: CometD
> Issue Type: Bug
> Components: javascript-common, javascript-dojo
> Affects Versions: 2.4.0.RC3
> Reporter: Saitz Peter

> Assignee: Simone Bordet
> Priority: Minor
>

Simone Bordet (Resolved) (JIRA)

unread,
May 28, 2012, 3:04:25 PM5/28/12
to comet...@googlegroups.com

[ http://bugs.cometd.org/browse/COMETD-329?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simone Bordet resolved COMETD-329.
----------------------------------

Fix Version/s: 2.5.0
Resolution: Incomplete

Closing due to inactivity.
If there is further information about usage of HaProxy with WebSocket, please reopen this bug of file a new one.

> websocket handshake does not carry data
> ---------------------------------------
>
> Key: COMETD-329
> URL: http://bugs.cometd.org/browse/COMETD-329
> Project: CometD
> Issue Type: Bug
> Components: javascript-common, javascript-dojo
> Affects Versions: 2.4.0.RC3
> Reporter: Saitz Peter
> Assignee: Simone Bordet
> Priority: Minor
> Fix For: 2.5.0
Reply all
Reply to author
Forward
0 new messages