What draft does java-websocket's WebSocketServer use?
Asked Answered
G

1

2

I can't figure out from the WebSocketServer.java source which draft it uses.

The WebSocketClient.java can use RFC 6455, Hybi 17, Hybi 10, Hixie 76, and Hixie 75 yet defaults to RFC 6455.

What draft does java-websocket's WebSocketServer use?

Gunrunning answered 10/1, 2014 at 2:46 Comment(0)
E
6

It supports whatever drafts you want it to support.

The constructor supports passing in a list of Drafts that you want the server to handle.

https://github.com/TooTallNate/Java-WebSocket/blob/master/src/main/java/org/java_websocket/server/WebSocketServer.java#L131-L150

Looks like it will always support Version 13 (RFC-6455) even if you pass in an empty Drafts list (as a null list will result in all 4 default Drafts being active), otherwise it has 4 drafts implemented for you to pick / choose / limit from.

https://github.com/TooTallNate/Java-WebSocket/tree/master/src/main/java/org/java_websocket/drafts

  • Draft_17 = Sec-WebSocket-Version: 13 (aka RFC-6455)
  • Draft_10 = Sec-WebSocket-Version: 8
  • Draft_76 = Sec-WebSocket-Version (unspecified, pre-versioning, Hixie-76)
  • Draft_75 = Sec-WebSocket-Version (unspecified, pre-versioning, Hixie-75)

Update: March 2013

As of Jetty 9.x, only RFC6455 (Sec-WebSocket-Version: 13) is supported. All support for draft versions of WebSocket have been dropped.

Elamite answered 10/1, 2014 at 13:12 Comment(1)
Thank you so much Joakim Erdfelt! It was late, and I definitely asked that question poorly, so thank you so much for answering this question in every possible way!Gunrunning

© 2022 - 2024 — McMap. All rights reserved.