Wednesday Jun 16, 2010

Grizzly 2.0: websockets support

We've added websockets (draft-hixie-thewebsocketprotocol-76) support into Grizzly 2.0, both client and server side and ported websockets-chat sample taken from Grizzly 1.9.19 (blog from Justin).

The API, common for client and server parts:

  • WebSocket, abstraction, which represents websocket unit
  • WebSocketEngine, which works as WebSocketApplication registry for server part and also contains base websockets handshake logic
  • WebSocketFilter, the key part of websocket implementation. It's Grizzly filter, which is responsible for handling websockets communication and and forward processing to correct websocket handlers.

The server-side API consists of

The client-side API:

Here are websockets chat sample sources, which includes:

To run the standalone websockets server please do following:

  • svn checkout https://www.dev.java.net/svn/grizzly/branches/2dot0/code/samples/websockets/chat
  • cd chat
  • mvn install
  • java -cp ./target/grizzly-websockets-chat-2.0.0-SNAPSHOT.jar com.sun.grizzly.samples.websockets.ChatWebSocketServer ./webapp

To run the standalone client (assume you have completed first 3 steps from the server side list)

  • java -cp ./target/grizzly-websockets-chat-2.0.0-SNAPSHOT.jar com.sun.grizzly.samples.websockets.ChatWebSocketClient

To run the application in browser, I used the latest dev version of Chromium, which implements the latest websockets draft and requested following URL: http://localhost:8080/index.html

So finally you're able to chat using standalone client and browser.

Monday Apr 19, 2010

Grizzly 1.9.19-beta2 with Websockets support!

We have released Grizzly 1.9.19-beta2, which has fixes for the issues [1], [2]. But the most interesting part is that this release has websockets support, and considering, that beta2 will be integrated into Glassfish v3.1 branch this week - Glassfish v3.1 will start to support websockets! Details on websockets implementation you can find on Justin's blog [3] and ask questions on Grizzly mailing list.

[1] http://tinyurl.com/y4zkt4j 

[2] http://tinyurl.com/y54zfpr

[3] http://www.antwerkz.com/ 

About

oleksiys

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today