Remotely connecting to socket.io instance? Possible?
1,001 views
Skip to first unread message
andy matthews
unread,
Sep 21, 2011, 10:03:33 AM9/21/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sock...@googlegroups.com
I'm sure this is a completely n00b question, but here goes.
I'm learning Node and my first test app is a chat app written using Socket.io (my code: https://github.com/commadelimited/Chat/). I've got it running on a Joyent smart machine at http://commadelimited.no.de/. It works great, but I'd like to skip hosting the HTML code at Joyent and run it somewhere else: localhost, another server, mobile app, etc.
My question is this: can I expect to run the socket server on Joyent, but hit that server/port from another website?
Daniel Shaw
unread,
Sep 21, 2011, 1:22:55 PM9/21/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sock...@googlegroups.com
Yes. That's basically how all our production systems work.
- @dshaw
pdeschen
unread,
Sep 21, 2011, 4:24:19 PM9/21/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Socket.IO
Since you can't access a websocket resource on another domain (e.g.,
joyent) because of same origin policy restrictions [1], you would
either need a proxy in front of both joyent and your html site [2] or
use jsonp polling within socket.io [3].
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Socket.IO
Oh. Nice then. I was under the false impression that it was not
possible! Thanks for the info!
Cheers
@pdeschen
On Sep 21, 8:09 pm, Shripad K <assortmentofso...@gmail.com> wrote:
> You can access a Websocket resource cross domain.
> My app depends on the very fact that you can use Websockets cross domain :)
> My app depends on the very fact that you can use Websockets cross domain :)
>
>
> On Thu, Sep 22, 2011 at 1:54 AM, pdeschen <pdesc...@gmail.com> wrote:
> > Since you can't access a websocket resource on another domain (e.g.,
> > joyent) because of same origin policy restrictions [1], you would
> > either need a proxy in front of both joyent and your html site [2] or
> > use jsonp polling within socket.io [3].
>
> > [1]http://en.wikipedia.org/wiki/Same_origin_policy > > [2]https://github.com/LearnBoost/socket.io/wiki/Nginx-and-Socket.io > > [3]
>
> > @pdeschen
>
> > On Sep 21, 1:22 pm, Daniel Shaw <ds...@dshaw.com> wrote:
> > > Yes. That's basically how all our production systems work.
>
> > > - @dshaw
>
> > > On Wed, Sep 21, 2011 at 7:03 AM, andy matthews <a...@commadelimited.com>
> > wrote:
> > > > I'm sure this is a completely n00b question, but here goes.
> > > > I'm learning Node and my first test app is a chat app written using
> > > > Socket.io (my code:https://github.com/commadelimited/Chat/). I've got
> > it
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sock...@googlegroups.com
Yes. Unfortunately this has not been documented anywhere. You need to just pass the entire URI as a string. The port would be parsed from the URI string itself.