-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
27 lines (25 loc) · 820 Bytes
/
index.html
File metadata and controls
27 lines (25 loc) · 820 Bytes
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
<html>
<body>
<h1>WebSocket Demo</h1>
<h3>Routing Key</h3>
<input id="routing_key" type="text"/>
<h3>Exchange</h3>
<input id="exchange" type="text"/>
<input type="submit" id="go"/>
<section id="content"></section>
<script src="http://www.google.com/jsapi"></script>
<script>google.load("jquery", "1.3")</script>
<script src="http://jquery-json.googlecode.com/files/jquery.json-2.2.min.js">
</script>
<script src="http://jquery-websocket.googlecode.com/files/jquery.websocket-0.0.1.js">
</script>
<script>
var ws = $.websocket("ws://127.0.0.1:8080/websocket", {
events: {
event: function(e) { $("#content").append(e.message); }}});
$('#go').click(function(){
alert("sending");
ws.send('message', { exchange: $("#exchange").val(), routing_key: $("#routing_key").val()});});
</script>
</body>
</html>