Skip to content

Commit e46a993

Browse files
committed
updated readme
1 parent da227bd commit e46a993

File tree

1 file changed

+42
-27
lines changed

1 file changed

+42
-27
lines changed

README.markdown

Lines changed: 42 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,65 @@ Java WebSockets
22
===============
33

44
This repository contains a barebones WebSocket server and client implementation
5-
written in 100% Java. The underlying classes are implemented using the Java
6-
`ServerSocketChannel` and `SocketChannel` classes, which allows for a
5+
written in 100% Java. The underlying classes are implemented `java.nio`, which allows for a
76
non-blocking event-driven model (similar to the
87
[WebSocket API](http://dev.w3.org/html5/websockets/) for web browsers).
98

109
Implemented WebSocket protocol versions are:
1110

12-
* [Hixie 75](http://tools.ietf.org/id/draft-hixie-thewebsocketprotocol-75.txt)
13-
* [Hixie 76](http://tools.ietf.org/id/draft-hixie-thewebsocketprotocol-76.txt)
14-
* [Hybi 10](http://tools.ietf.org/id/draft-ietf-hybi-thewebsocketprotocol-10.txt)
15-
* [Hybi 17](http://tools.ietf.org/id/draft-ietf-hybi-thewebsocketprotocol-17.txt)
1611
* [RFC 6455](http://tools.ietf.org/html/rfc6455)
12+
* [Hybi 17](http://tools.ietf.org/id/draft-ietf-hybi-thewebsocketprotocol-17.txt)
13+
* [Hybi 10](http://tools.ietf.org/id/draft-ietf-hybi-thewebsocketprotocol-10.txt)
14+
* [Hixie 76](http://tools.ietf.org/id/draft-hixie-thewebsocketprotocol-76.txt)
15+
* [Hixie 75](http://tools.ietf.org/id/draft-hixie-thewebsocketprotocol-75.txt)
1716

17+
[Here](https://github.com/TooTallNate/Java-WebSocket/wiki/Drafts) some more details about protocol versions/drafts.
1818

19-
Running the Example
20-
-------------------
2119

22-
There's a simple chat server and client example located in the `example`
23-
folder. First, compile the example classes and JAR file:
20+
##Build
21+
There are 2 ways to build but automatically but there is nothing against just putting the source path ```src/main/java ``` on your buildpath.
22+
23+
###Ant
2424

2525
``` bash
26-
ant
26+
ant
2727
```
28+
will
29+
30+
- create the javadoc of this library at ```doc/```
31+
- build the library itself: ```dest/java_websocket.jar```
2832

29-
Then, start the chat server (a `WebSocketServer` subclass):
33+
To perform more distinct operations take a look at ```build.xml```.
34+
35+
###Maven
36+
37+
There is maven support. More documentation in that is yet to come...
38+
39+
40+
Running the Examples
41+
-------------------
42+
43+
**Note:** If you're on Windows, then replace the `:` (colon) in the classpath
44+
in the commands below with a `;` (semicolon).
45+
46+
After you build the library you can start the chat server (a `WebSocketServer` subclass):
3047

3148
``` bash
32-
java -cp build/examples:dist/WebSocket.jar ChatServer
49+
java -cp build/examples:dist/java_websocket.jar ChatServer
3350
```
3451

35-
Now that the server is started, we need to connect some clients. Run the
52+
Now that the server is started, you need to connect some clients. Run the
3653
Java chat client (a `WebSocketClient` subclass):
3754

3855
``` bash
39-
java -cp build/examples:dist/WebSocket.jar ChatClient
56+
java -cp build/examples:dist/java_websocket.jar ChatClient
4057
```
4158

42-
__Note:__ If you're on Windows, then replace the `:` (colon) in the classpath
43-
in the commands above with a `;` (semicolon).
44-
4559
The chat client is a simple Swing GUI application that allows you to send
4660
messages to all other connected clients, and receive messages from others in a
4761
text box.
4862

49-
There's also a simple HTML file chat client `chat.html`, which can be opened
50-
by any browser. If the browser natively supports the WebSocket API, then it's
63+
In the example folder is also a simple HTML file chat client `chat.html`, which can be opened by any browser. If the browser natively supports the WebSocket API, then it's
5164
implementation will be used, otherwise it will fall back to a
5265
[Flash-based WebSocket Implementation](http://github.com/gimite/web-socket-js).
5366

@@ -73,16 +86,18 @@ in **your** subclass.
7386

7487
WSS Support
7588
---------------------------------
89+
This library supports wss.
90+
To see how to use wss please take a look at the examples.<br>
7691

77-
WSS support is still VERY young ( https://github.com/TooTallNate/Java-WebSocket/pull/101 ).
78-
The only way to use wss is currently the one shown in the example. That also means that you have to switch between ws and wss.
79-
You can not have both at the same time on the same port.
80-
81-
If you do not have a valid certificate in place then you will have to create a self signed one.
92+
If you do not have a valid **certificate** in place then you will have to create a self signed one.
8293
Browsers will simply refuse the connection in case of a bad certificate and will not ask the user to accept it.
83-
So the first step will be to make a browser to accept your self signed certificate. ( https://bugzilla.mozilla.org/show_bug.cgi?id=594502 )
94+
So the first step will be to make a browser to accept your self signed certificate. ( https://bugzilla.mozilla.org/show_bug.cgi?id=594502 ).<br>
8495
If the websocket server url is `wss://localhost:8000` visit the url `htts://localhost:8000` with your browser. The browser will recognize the handshake and allow you to accept the certificate.
8596

97+
The vm option `-Djavax.net.debug=all` can help to find out if there is a problem with the certificate.
98+
99+
It is currently not possible to accept ws and wss conections at the same time via the same websocket server instance.
100+
86101
I ( @Davidiusdadi ) would be glad if you would give some feedback whether wss is working fine for you or not.
87102

88103
Minimum Required JDK
@@ -128,7 +143,7 @@ Getting Support
128143

129144
If you are looking for help using `Java-WebSocket` you might want to check out the
130145
[#java-websocket](http://webchat.freenode.net/?channels=java-websocket) IRC room
131-
on the FreeNode IRC network.
146+
on the FreeNode IRC network.
132147

133148

134149
License

0 commit comments

Comments
 (0)