Getting /info page

497 views
Skip to first unread message

VG

unread,
May 23, 2012, 10:42:29 PM5/23/12
to sockjs
Hi guys, I've read previous message but still doesn't understand why
my socket-js-client, when creating new SockJS(<url>) object trying to
get <url>/info page first. I've read SockJS protocol document and see
that this url is called before the client starts the session.
But no examples presented in sockjs-node/sockjs-client has /info
'prefix' (or handler).
SO my main question is what kind of info I need to sent when socket
gets /info page? May you enumerate the structure of response?
As I can see, it should be like
data['websocket']
data['cookie_needed']
data['origins']
data['entropy']
...etc (I don't know Python but it seems it tests for this)
Also, the reply should(??) be in JSON format, right?

And by the way, do you have guys simple chat example? (not just echo
server) Where all protocol issues are resolved (like /info page, /
iframe* pages, etc). I mean 'production-ready' example.

Thanks a much!

Marek Majkowski

unread,
May 24, 2012, 10:04:08 AM5/24/12
to freela...@gmail.com, sockjs
On Thu, May 24, 2012 at 3:42 AM, VG <freela...@gmail.com> wrote:
> Hi guys, I've read previous message but still  doesn't understand why
> my socket-js-client, when creating new SockJS(<url>) object trying to
> get <url>/info page first. I've read SockJS protocol document and see
> that this url is called before the client starts the session.
> But no examples presented in sockjs-node/sockjs-client has /info
> 'prefix' (or handler).
> SO my main question is what kind of info I need to sent when socket
> gets /info page? May you enumerate the structure of response?
> As I can see, it should be like
> data['websocket']
> data['cookie_needed']
> data['origins']
> data['entropy']
> ...etc (I don't know Python but it seems it tests for this)
> Also, the reply should(??) be in JSON format, right?

The best thing is to run sockjs-node server and check out what
it is doing. For example:
http://sockjs-node.cloudfoundry.com/echo/info

> And by the way, do you have guys simple chat example? (not just echo
> server) Where all protocol issues are resolved (like /info page, /
> iframe* pages, etc). I mean 'production-ready' example.

What are you trying to do, are you trying to build a custom sockjs server?

Maybe start off by using sockjs-node or sockjs-tornado or other
established server.

If so, take a look at the basic examples:
https://github.com/sockjs/sockjs-node/tree/master/examples

Marek
Reply all
Reply to author
Forward
0 new messages