[plugin] SockJS

  • <center><font size="6">SockJS</font></center>

    Sockjs can be used as an alternative to official websocket plugin or socket.io.

    As we wait for a Socket.io 1.0 I've decided to put my efforts on SockJS plugin. Because of the design of sockjs library, the plugin is almost identical to the official websocket plugin, but enables you to use all advantages of sockjs. There's more work to be done, if you are using this plugin, please report back on how did it go.

    From the official SockJS readme:

    SockJS is a browser JavaScript library that provides a WebSocket-like object. SockJS gives you a coherent, cross-browser, Javascript API which creates a low latency, full duplex, cross-domain communication channel between the browser and the web server.

    Under the hood SockJS tries to use native WebSockets first. If that fails it can use a variety of browser-specific transport protocols and presents them through WebSocket-like abstractions.

    SockJS is intended to work for all modern browsers and in environments which don't support WebSocket protcol, for example behind restrictive corporate proxies.

    You can find a simple test demo here, and the plugin here.

    If you find any bugs, or have some ideas on how to improve this plugin, please head over here

    For more info on SockJS, check here.

    Cheers!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Isn't better than Bottleneck?

  • Bottleneck I believe is Rexrainbows's(I could be wrong on who's) server technology. Where as sockjs is a transport wrapper between client and server. sockjs is a move to replace socket.io who's current developement has slowed down.

    So as an example if a browser(likely mobile) can't use websocket sockjs will revert to making calls along the lines of AJAX or essentiaclly whatever. and recieve under the same line.

    It's really a good idea :)

    Sounds good JohnnySheffield looking forward to seeing where this goes :)

  • jayderyu

    Yes, Bottleneck is a server made by me. It used node.js + socket.io.

  • WoW, just, WoW!

    Best wishes for this initiative.

  • Hey Johnny, I'm not sure how actively you are working on this plugin but I think we should talk and see how we can further move this plugin.

    In anycase, I've been tinkering around with multiplayer functionality and I've tested just about everything (to no avail), until I found SockJS. I was finally able to get some sort of real time data transferring through a NodeJS server (hosted at Nodejitsu).

    And to my point... I've found a small bug that I'm not sure if it has to do with the sockjs plugin or not. Essentially, what happens is:

    On SockJS even "On Message": when I added the System Trigger once condition to it, the sockjs doesn't recognize this and still runs the loop multiple times, instead of just once.

    Let me know if you know anything about this, thanks a lot!

  • I actually found a way around this. For the purposes of my game it should work.

    If I'm able to complete the basic concepts of my game with sockjs in multiplayer, I'll definitely let you know about it.

  • hi hello i have try your plugin and i have put the server file in my server but wen i try to connect nothing happen.

    Some One Can Give me a help with please

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)