forked from TooTallNate/Java-WebSocket
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
104 lines (91 loc) · 4.85 KB
/
Copy pathindex.html
File metadata and controls
104 lines (91 loc) · 4.85 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Java-WebSocket by TooTallNate</title>
<link rel="stylesheet" href="stylesheets/styles.css">
<link rel="stylesheet" href="stylesheets/pygment_trac.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="javascripts/respond.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!--[if lt IE 8]>
<link rel="stylesheet" href="stylesheets/ie.css">
<![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
</head>
<body>
<div id="header">
<nav>
<li class="fork"><a href="https://github.com/TooTallNate/Java-WebSocket">View On GitHub</a></li>
<li class="downloads"><a href="https://github.com/TooTallNate/Java-WebSocket/zipball/master">ZIP</a></li>
<li class="downloads"><a href="https://github.com/TooTallNate/Java-WebSocket/tarball/master">TAR</a></li>
<li class="title">DOWNLOADS</li>
</nav>
</div><!-- end header -->
<div class="wrapper">
<section>
<div id="title">
<h1>Java-WebSocket</h1>
<p>A barebones WebSocket client and server implementation written in 100% Java.</p>
<hr>
<span class="credits left">Project maintained by <a href="https://github.com/marci4">marci4</a></span>
<span class="credits right">Hosted on GitHub Pages — Theme by <a
href="http://twitter.com/#!/michigangraham">mattgraham</a></span>
</div>
<h1>Java WebSockets</h1>
<p>This repository contains a barebones WebSocket server and client implementation
written in 100% Java. The underlying classes are implemented <code>java.nio</code>, which allows for a
non-blocking event-driven model (similar to the <a href="http://dev.w3.org/html5/websockets/">WebSocket
API</a> for web browsers).</p>
<p>Implemented WebSocket protocol versions are:</p>
<ul>
<li><a href="http://tools.ietf.org/html/rfc6455">RFC 6455</a></li>
</ul>
<p>
<a href="https://github.com/TooTallNate/Java-WebSocket/wiki/Drafts">Here</a> some more details about
protocol versions/drafts.
</p>
<h2>Getting started</h2>
<h3>Dependency management tools</h3>
<p>You can find instructions on how to use this library for your dependency management tool in <a
href="https://mvnrepository.com/artifact/org.java-websocket/Java-WebSocket">mvnrepository.com</a>.</p>
<h3>Github releases</h3>
<p>You can also find any releases <a href="https://github.com/TooTallNate/Java-WebSocket/releases">here</a>.</p>
<h2>Writing your own WebSocket Server</h2>
<p>
The <code>org.java_websocket.server.WebSocketServer</code> abstract class implements the
server-side of the <a href="http://www.whatwg.org/specs/web-socket-protocol">WebSocket Protocol</a>.
A WebSocket server by itself doesn't do anything except establish socket
connections though HTTP. After that it's up to **your** subclass to add purpose.
</p>
<p>
An example for a WebSocketServer can be found in both the <a
href="https://github.com/TooTallNate/Java-WebSocket/wiki#server-example">wiki</a> and the <a
href="https://github.com/TooTallNate/Java-WebSocket/tree/master/src/main/example">example</a> folder.
</p>
<h2>Writing your own WebSocket Client</h2>
<p>
The <code>org.java_websocket.client.WebSocketClient</code> abstract class can connect to
valid WebSocket servers. The constructor expects a valid <code>ws://</code> or <code>wss://</code> URI to
connect to. Important events <code>onOpen</code>, <code>onClose</code>, <code>onMessage</code> and <code>onError</code>
get fired throughout the life of the WebSocketClient, and must be implemented
in **your** subclass.
</p>
<p>
An example for a WebSocketClient can be found in both the <a
href="https://github.com/TooTallNate/Java-WebSocket/wiki#client-example">wiki</a> and the <a
href="https://github.com/TooTallNate/Java-WebSocket/tree/master/src/main/example">example</a> folder.
</p>
<h2>Examples</h2>
<p>You can find a lot of additional examples <a
href="https://github.com/TooTallNate/Java-WebSocket/tree/master/src/main/example">here</a>.</p>
<h2>License</h2>
<p>Everything found in this repo is licensed under an MIT license. See
the <code>LICENSE</code> file for specifics.</p>
</section>
</div>
</body>
</html>