Problems with websocket_messaging

35 views
Skip to first unread message

Martin Weissenboeck

unread,
Sep 21, 2016, 6:29:09 AM9/21/16
to web2py-users
I have tried the websocket_messaging (gluon/contrib/websocket_messaging.py) on a Windows 10 laptop - it works very fine!

The next step was an impementation on a Linux machine (Ubuntu 14.04.4, last Web2py version 2.14.6)

The line

websocket_send('http://localhost:8888', form.vars.message, 'mykey', 'mygroup')

​works, because after entering "aa" the tornado servers send something like ​
  
1474441282.49:MESSAGE to mygroup:aa

to the console.

But the javascript console shows an error:

WebSocket connection to 'ws://localhost:8888/realtime/mygroup' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSEDweb2py_websocket @ web2py.js:458(anonymous function) @ index:96j @ jquery.js:2fireWith @ jquery.js:2ready @ jquery.js:2J @ jquery.js:2


​What is wrong? Any ideas?
Regards, Martin

Zoltan Vincze

unread,
Sep 21, 2016, 8:40:55 AM9/21/16
to web2py-users, mwei...@gmail.com
It seems to be a connection problem. Try to test whether tornado is installed correctly together with its dependencies. I used this to get the last version running on ubuntu a couple days ago:


You can make POST or GET request to the URL directly to test tornado. If it works than the problem may be caused by web2py.js
 
Reply all
Reply to author
Forward
0 new messages