[JIRA] (COMETD-428) Enable configuration for "ws.minVersion" from CometdServlet's init-param (web.xml)

18 views
Skip to first unread message

jdf (JIRA)

unread,
May 15, 2013, 6:45:51 PM5/15/13
to comet...@googlegroups.com
jdf created Improvement COMETD-428
Issue Type: Improvement Improvement
Affects Versions: 2.6.0
Assignee: Unassigned
Components: websocket-java-server
Created: 15/May/13 6:44 PM
Description:

Hello,

Original Description at: https://groups.google.com/forum/#!topic/cometd-users/ZS-6YIEJxQg

At this time, I am evaluating last release of "cometd 2.6.0" against "jetty 7.6.10.v20130312". I experienced problem when establishing web-socket socket connection from iOS Safari 5.x with following message logged at server console: "WARN:oejw.WebSocketFactory:Unsupported websocket client version specification <Unspecified, likely a pre-draft version of websocket>, configured minVersion [13], reported supported versions [13]"

After digging into details, I realized that related issue was recently addressed as part of jetty project "https://bugs.eclipse.org/bugs/show_bug.cgi?id=401317". Basically, the fix involves to min-version = -1 on websocket-factory (
"WebSocketFactory.setMinVersion(-1);")

In terms of regular jetty's WebSocketServlet can be done by adding following init-parameter on web.xml file (Jetty's WebSocketServlet "injects" that parameter into WebSocketFactory):

Set the WebSocketServlet init-parameter
<init-param>
<param-name>minVersion</param-name>
<param-value>-1</param-value>
</init-param>

In terms of cometd, I realized that a small change on cometd's WebSocketTransport was required to have WebSocketFactory be injected with the init-parameter associated to CometdServlet:

public void init()

{ ... int minVersion = getOption(MIN_VERSION_OPTION, _factory.getMinVersion()); _factory.setMinVersion(minVersion); ... }

After that change, the problem had gone and iOS Safari 5.x is now successfully establishing web-sockets connection. I wonder if this change can be incorporated as part of the next version of Cometd (2.6.1?)

Thanks!

Environment: WebSocket Support for iOS Safari 5.x on CometD 2.6.0 and jetty 7.6.10.v20130312
Fix Versions: 2.6.1
Project: CometD
Priority: Trivial Trivial
Reporter: jdf
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Simone Bordet (JIRA)

unread,
Jun 3, 2013, 4:14:51 AM6/3/13
to comet...@googlegroups.com
Simone Bordet resolved Improvement COMETD-428 as Fixed

Fixed introducing parameter "ws.minVersion".

Change By: Simone Bordet (03/Jun/13 4:13 AM)
Status: Open Resolved
Assignee: Simone Bordet
Fix Version/s: 2.7.0
Fix Version/s: 2.6.1
Resolution: Fixed

Simone Bordet (JIRA)

unread,
Jun 3, 2013, 10:35:51 AM6/3/13
to comet...@googlegroups.com
Change By: Simone Bordet (03/Jun/13 10:34 AM)
Resolution: Fixed
Status: Resolved Reopened

Simone Bordet (JIRA)

unread,
Jun 3, 2013, 10:35:52 AM6/3/13
to comet...@googlegroups.com
Simone Bordet resolved Improvement COMETD-428 as Won't Fix
Change By: Simone Bordet (03/Jun/13 10:34 AM)
Status: Reopened Resolved
Resolution: Won't Fix

Simone Bordet (JIRA)

unread,
Jun 3, 2013, 10:35:51 AM6/3/13
to comet...@googlegroups.com
Simone Bordet commented on Improvement COMETD-428

Actually, I reverted the fix and removed the ability to set this parameter.

Parameter "minVersion" was introduced in WebSocketServlet a while back, when Safari did not have a decent implementation of WebSocket, as a "hack" to workaround Safari indecence.

Turns out that enabling this parameter exposed nasty Safari bugs, as well as Jetty bugs - including a rare 100% CPU spinning situation.

My preferred choice would be to not support ws.minVersion, so that the server is safe.
By not supporting {{ws.minVersion} the browser will fall back to long-polling, so the functionality is still there, transparently for the application.
If you want to use WebSocket, upgrade to a decent version of Safari.

Finally, it's a matter of time/resources to fix the 100% CPU "bug" triggered by a buggy Safari in Jetty. If we had infinite resources we could have fixed it.
But turns out it's a rare bug, difficult to reproduce, happens only on old versions of Safari, which is a teeny fractions of the browsers out there, which is implementing a WebSocket draft dubbed as "experimental"... it was deemed as not worth the effort.

Reply all
Reply to author
Forward
0 new messages