-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.txt
69 lines (50 loc) · 1.9 KB
/
README.txt
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
Deploying
===========
Radiate comes with a buildout configuration which allow you to deploy this
quickly::
git clone https://[email protected]/kagesenshi/radiate.git radiate
cd radiate
python bootstrap.py
./bin/buildout
The command above will pull the dependencies needed by radiate and install it
in a contained environment.
To start the server, execute::
./bin/radiate-admin fg
Subscribing to channel
=======================
A channel can be any path in the URL. Eg: http://localhost:8888/this/is/a/channel
You can subscribe to a channel using the socketIO library::
<!DOCTYPE html>
<html>
<head>
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js">
</script>
<script type="text/javascript"
src="http://cdn.socket.io/stable/socket.io.js"></script>
<script>
WEB_SOCKET_SWF_LOCATION = 'http://cdn.socket.io/stable/WebSocketMain.swf'
$(document).ready(function () {
ws = new io.Socket('localhost', {
port: '8888',
resource: 'this/is/a/channel',
transports:['websocket', 'flashsocket','xhr-multipart',
'xhr-polling']
})
ws.on('message', function(message) {
// Do something after receiving a message from server
});
ws.connect();
});
</script>
</head>
<body>
</body>
</html>
Sending to a channel
=====================
You can use POST or GET to send data to the channel. Currently radiate is
using 'data' request variable, in the future I'll be making its possible to
post JSON instead.
To send data to a channel using GET, you can just load this:
http://localhost:8888/this/is/a/channel/push?data=putyourdatahere