-
Notifications
You must be signed in to change notification settings - Fork 22
/
index.old.html
127 lines (125 loc) · 3.78 KB
/
index.old.html
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Easy WebSocket - like WebSocket but no server setup and available in any browser</title>
<style type="text/css">
body {
margin-top: 1.0em;
background-color: #22252A;
font-family: "Helvetica,Arial,FreeSans";
color: #EEE;
}
#container {
margin: 0 auto;
width: 700px;
}
h1 {
font-size : 3.8em;
text-align : center;
margin-top : 20px;
margin-bottom : 20px;
}
h1 .small { font-size: 0.4em; }
h1 a {
color : #cd5;
text-decoration: none
}
h2 {
font-size: 1.5em; color: lightSteelBlue;
}
h3 {
text-align: center; color: #b523ab;
}
a { color: #cd5; }
.description {
font-size: 1.2em;
margin-bottom: 20px;
margin-top: 10px;
font-style: italic;
text-align: center;
}
pre {
background: #000;
color: #EEE;
padding: 15px;
}
hr { border: 0; width: 80%; border-bottom: 1px solid #aaa;
margin-bottom : 3em;
}
.tutorial {
font-weight : bolder;
}
.tutorial b {
font-size : 1.2em;
}
.footer { text-align:center; padding-top:30px; font-style: italic; }
</style>
</head>
<body>
<div id="container">
<h1>
<a href="http://easywebsocket.org">Easy WebSocket</a>
</h1>
<div class="description">
like WebSocket but no server setup and available in any browser
</div>
<hr>
<p>
<b>EasyWebSocket</b> aims to make realtimes webapps in every browser without the trouble
to setup servers.
</p>
<h2>How to Use It</h2>
<p>
Include the following in your webpage and it just works.
</p>
<pre>
<script src="http://easywebsocket.org/easyWebSocket.min.js"></script>
<script>
var socket = new EasyWebSocket("ws://example.com/resource");
socket.onopen = function(){
socket.send("hello world!")
}
socket.onmessage= function(event){
alert("received "+ event.data)
}
</script></pre>
<p class="tutorial">
<b>Step 1:</b> You connect the socket to a given url
</p>
<p class="tutorial">
<b>Step 2:</b> What you send() thru this socket is sent to all sockets connected the same url
</p>
<p>See this code <a href="example/example.html">live</a>.
No server setup, no cross-origin issue to care about... <b>It is that easy!</b>
</p>
<h2>Demo</h2>
<p>
Seeing it work is always nice. Here is a little
<a href="contrib/chat">chat application</a>
on top of EasyWebSocket.
It is possible to <a href="contrib/monitor/">monitor EasyWebSocket time efficiency</a>.
</p>
<h2>Code</h2>
<p>
EasyWebSocket is written by <a href="http://jetienne.com">Jerome Etienne</a>.
The code is available on github at <a href="http://github.com/jeromeetienne/EasyWebsocket">EasyWebSocket</a>
under <a href="https://github.com/jeromeetienne/EasyWebsocket/raw/master/MIT-LICENSE.txt">MIT license</a>.
The API is copied on the <a href="http://dev.w3.org/html5/websockets/">WebScocket standard API</a>, thus
compatible and easy to learn.
I did a <a href="https://docs.google.com/present/view?id=dhng4bgf_47gb6txzds">presentation</a> for it.
</p>
</div>
<!-- google analytic support -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-4037844-15']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>