Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix for chatroom example.

  • Loading branch information...
commit 15ccb44f207dbcc6794866dd68c25f927f9cbbad 1 parent 21c1f73
Ziga Ham authored
13 examples/chatroom/chatroom.py
@@ -30,15 +30,18 @@ def on_close(self):
30 30 p.send("A user has left.")
31 31
32 32 #use the routes classmethod to build the correct resource
33   -ChatRouter = tornadio.get_router(ChatConnection)
  33 +ChatRouter = tornadio.get_router(ChatConnection, {
  34 + 'enabled_protocols': [
  35 + 'websocket',
  36 + 'flashsocket',
  37 + 'xhr-multipart',
  38 + 'xhr-polling'
  39 + ]
  40 +})
34 41
35 42 #configure the Tornado application
36 43 application = tornado.web.Application(
37 44 [(r"/", IndexHandler), ChatRouter.route()],
38   - enabled_protocols = ['websocket',
39   - 'flashsocket',
40   - 'xhr-multipart',
41   - 'xhr-polling'],
42 45 flash_policy_port = 843,
43 46 flash_policy_file = op.join(ROOT, 'flashpolicy.xml'),
44 47 socket_io_port = 8001
11 examples/chatroom/index.html
@@ -7,7 +7,16 @@
7 7 <script>
8 8 window.onload = function() {
9 9
10   - var s = new io.Socket(window.location.hostname, {port: 8001, rememberTransport: false});
  10 + var s = new io.Socket(window.location.hostname, {
  11 + port: 8001,
  12 + rememberTransport: false,
  13 + transports: [
  14 + 'websocket',
  15 + 'flashsocket',
  16 + 'xhr-multipart',
  17 + 'xhr-polling'
  18 + ]
  19 + });
11 20 s.connect();
12 21
13 22 s.addEvent('connect', function() {

0 comments on commit 15ccb44

Please sign in to comment.
Something went wrong with that request. Please try again.