1

I'd like to access the sockjs api that meteor leverages to do its real-time updating. Meteor emits something like http://localhost:3000/sockjs/348/zfjta7hy/xhr and I'd like to leverage the sockjs api in order to circumvent the pub/sub stuff in meteor with something like this:

var sock = new SockJS('http://localhost:3000/sockjs/dynamically_created_by_meteor');

And then simply use sock to do some collaborative work that's outside the scope of meteor's real-time updating. I haven't dug through the code enough yet to see this, but am wondering if anyone has an idea on how I can get a sockjs url handle in meteor? Thanks for your help!

TimDog
  • 8,758
  • 5
  • 41
  • 50

2 Answers2

0

After digging through firebug and examining the Meteor object, I found this, which provides the SockJS url as of Meteor 0.3.9

Meteor.default_connection.stream.socket._transport.poll.recv_url
TimDog
  • 8,758
  • 5
  • 41
  • 50
  • Ultimately, I intend on building a sockjs client using the above URL and issue `send` commands to broadcast custom events, but the `Meteor.default_connection.stream` object has a `send` command as well, though I'm not sure yet whether it's more appropriate to leverage that directly or build my own sockjs object with the URL. – TimDog Aug 20 '12 at 13:11
0

I answered a similar question here, the solution isn't perfect but it works: Publish arbitrary data and automatically update HTML

Community
  • 1
  • 1
Jabbslad
  • 546
  • 3
  • 10