Skip to content

Commit e9e9991

Browse files
committed
Updated the README file for the ant build script and removed warning for Draft 76.
1 parent 35d4d28 commit e9e9991

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

README.markdown

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,51 @@
11
Java WebSockets
22
===============
3-
### CAUTION/TODO: This WebSocket implementation adheres to an older draft of the WebSocket specification (draft 75). The [current draft](http://www.whatwg.org/specs/web-socket-protocol/) (draft 76) is a TODO item/fork-worthy! ###
43

5-
This repository contains a simple WebSocket server and client implementation
6-
in Java. The underlying classes use the Java classes `ServerSocketChannel` and
7-
`SocketChannel`, to allow for a non-blocking event-driven model (similar to the
4+
This repository contains a barebones WebSocket server and client implementation
5+
written 100% in in Java. The implementation supports both the older draft 75,
6+
and current draft 76. The underlying classes use the Java
7+
`ServerSocketChannel` and `SocketChannel` classes, which allows for a
8+
non-blocking event-driven model (similar to the
89
[WebSocket API](<http://dev.w3.org/html5/websockets/>) for web browsers).
910

1011
Running the Example
1112
-------------------
1213

1314
There's a simple chat server and client example located in the `example`
14-
folder.
15+
folder. First, compile the example classes and JAR file:
16+
ant
1517

16-
First, start the chat server (a WebSocketServer subclass):
17-
cd example/
18-
java ChatServer
18+
Then, start the chat server (a WebSocketServer subclass):
19+
java -cp example:dist/WebSocket.jar ChatServer
1920

2021
Now that the server is started, we need to connect some clients. Run the
2122
Java chat client (a WebSocketClient subclass):
22-
java ChatClient
23+
java -cp example:dist/WebSocket.jar ChatClient
2324

2425
The chat client is a simple Swing GUI that allows you to send messages to
25-
all other connected clients, and recieve messages from others in a text box.
26+
all other connected clients, and receive messages from others in a text box.
2627

2728
There's also a simple HTML file chat client `chat.html`, which can be opened
28-
by any browser. If the browser natively supports the WebSocket API, then it will
29-
be used, otherwise it will fall back to a
29+
by any browser. If the browser natively supports the WebSocket API, then it's
30+
implementation will be used, otherwise it will fall back to a
3031
[Flash-based WebSocket Implementation](<http://github.com/gimite/web-socket-js>).
3132

3233
Writing your own WebSocket Server
3334
---------------------------------
3435

36+
The `net.tootallnate.websocket.WebSocketServer` class implements the
37+
server-side of the
38+
[WebSocket Protocol](<http://www.whatwg.org/specs/web-socket-protocol/>).
3539
A WebSocket server by itself doesn't do anything except establish socket
36-
connections though HTTP. After that it's up to a subclass to add purpose.
37-
The `WebSocketServer` class implements the server-side of the
38-
[WebSocket Protocol](<http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol>).
40+
connections though HTTP. After that it's up to **your** subclass to add purpose.
3941

4042
Writing your own WebSocket Client
4143
---------------------------------
4244

43-
The `WebSocketClient` class can connect to valid WebSocket servers.
44-
The constructor expects a valid `ws://` URI to connect to. Important
45-
events `onOpen`, `onClose`, and `onMessage` get fired throughout the life
46-
of the WebSocketClient, and must be implemented in your subclass.
45+
The `net.tootallnate.websocket.WebSocketClient` class can connect to valid
46+
WebSocket servers. The constructor expects a valid `ws://` URI to connect to.
47+
Important events `onOpen`, `onClose`, and `onMessage` get fired throughout the
48+
life of the WebSocketClient, and must be implemented in your subclass.
4749

4850
License
4951
-------

0 commit comments

Comments
 (0)