Problems with websocket_messaging

Skoðað 35 sinnum
Fara í fyrstu ólesnu skilaboð

Martin Weissenboeck

ólesið,
21. sep. 2016, 06:29:0921.9.2016
til 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

ólesið,
21. sep. 2016, 08:40:5521.9.2016
til 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
 
Svara öllum
Svara höfundi
Senda áfram
0 ný skilaboð