socket.io to connect to tornado websocket

204 views
Skip to first unread message

António Ramos

unread,
Apr 28, 2015, 6:34:05 AM4/28/15
to web...@googlegroups.com
hello i have an app with tornado websockets in the back
my webpage has this code
web2py_websocket('ws://serverip:12200/realtime/mygroup1')

it just works !!

now i need to connect to my tornado websocket from a nodejs server using socket.io

this line of code does not connect
var socket = io('ws://serveip:12200/realtime/');


any help would be appreciated

António


Derek

unread,
Apr 30, 2015, 4:18:18 PM4/30/15
to web...@googlegroups.com
those aren't the same url. don't you need /mygroup1 ?

António Ramos

unread,
May 1, 2015, 12:16:01 PM5/1/15
to web...@googlegroups.com
I really missed a line 
here it is

socket.emit('subscribe', 'mygroup1');
according to this meteor package documentation
https://atmospherejs.com/joncursi/socket-io-client
but it does not work!! dont know why...

Iḿ trying to have a meteorjs app connecting to my web2py tornado websockets app
any ideas?

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Derek

unread,
May 1, 2015, 12:29:44 PM5/1/15
to web...@googlegroups.com
I believe you have to put the port in a variable...

var socket = new io.Socket('ws://localhost/realtime/mygroup1',{
 port
: 12200
});

António Ramos

unread,
May 2, 2015, 6:26:14 PM5/2/15
to web...@googlegroups.com
with port in a variable i still dont connect...
Reply all
Reply to author
Forward
0 new messages