PolySocketAmerican Fork, UT

  • 77 Commits
  • 59 Pushes
  • 38 Deploys
Launch Site

PolySocket

By Nodest Colony

Screencast
Quick Intro

PolySocket is a true WebSocket polyfill. Program your front-end and back-end code using pure delicious WebSockets (and we'll transparently upgrade older browsers to speak WebSockets).

Description

PolySocket enables true WebSockets in all browsers. This lets you write a pure WebSocket server for your backend realtime service. Other alternatives like socket.io/engine.io/sockjs/primus implement their own protocol, whereas WebSockets are standardized. The end result is an easier-to-scale application, simpler codebase, and the ability to use any programming language.

Judging Instructions
  • Visit http://nodest-colony.2013.nodeknockout.com/ (will be renamed to polysocket.io after the competition)
  • Notice the chat server demo in the demo section of the web page
  • We're connecting to a 3rd party WebSocket server, which only understands WebSockets
  • We've configured our demo to NOT use WebSockets, but to force our demo to use xhr-streaming
  • Open developer tools and notice the requests to polysocket.io, and no WebSocket connections
  • Open the demo in IE 6/7/8 (browserstack.com helps).
  • Notice that IE works!
  • The backend server did NOTHING outside of serving WebSockets, yet IE is still able to participate in this WebSocket experience
  • Rip out socket.io/engine.io/sockjs/primus from your own projects source code
What they Used

"dependencies": { "nko": "*", "express": "~3.4.4", "q": "~0.9.7", "uuid": "~1.4.1", "ws": "~0.4.31", "jade": "~0.35.0" }

And we connected to http://html5demos.com/web-socket

Who

Votes

Your Vote

Voting is now closed.

Other Votes

  • (10)
  • judge

    This looks really similar to SockJS — but without the need for a server-side counterpart library. Cool.

    (I didn't understand that at first.)

  • judge

    keep working on this guys, I'm curious how this compares to socket.io or sockjs

  • contestant

    There a lot of websocket fallback out there: sockjs, socket.io, primus etc. And your one only uses xhr-polling as an options although there are more powerful available like flash-sockets. But it's interesting since it's only clientside.

    • supershabam
      contestant

      Yeah we think it's an interesting approach. Just a prototype though. Definitely need more transports... Though suggesting flash socket makes me die a little inside.

      Thanks for the feedback

  • judge

    Mozilla

  • judge

    Brilliant idea. Would love to see this taken heaps further. Why isn't this how all other websocket tools work? Bah.

    Probably need to reassure people about security/reliability of your "PolySocket Relay" and also explain why it's necessary/can I run my own? Would like to know more about how this works. Great stuff.

    • supershabam
      contestant

      Thank you. Yes we want people to be able to run their own relay so they can own security. We need to give the relay a whitelist of web socket servers it can proxy.

  • contestant
  • judge
  • judge

    Browserling

    Cool to see something new done with websockets.

  • contestant
  • judge

    @vigour_io

    I really like how the APIs of PolySocket and WebSockets match. The website is clear to understand and easy to test out. Great library.

  • judge

    Why new PolySocket? My fave polyfils take on the real API seamlessly.

    • supershabam
      contestant

      Sorry, I'm confused. That's what we're doing with PolySocket: strictly implementing the WebSocket interface.

      Other solutions that solve this problem all force their own API.

    • taterbase
      contestant

      Thanks for the feedback! :)

      What polyfills do you currently use? This is meant to be a platform agnostic polyfill so that you don't have to mess around with runtime specific shims like Socket.IO, SockJS, and others. You can pick your favorite language for the server, build it expecting vanilla web sockets, and let PolySocket worry about unsupported clients.

    • supershabam
      contestant

      Sorry, took me a while to realize what you said.

      var ps = new PolySocket(uri) // why not WebSocket

      I like that. Definitely need to give PolySocket some love in the way it clobbers/takes-over globals.

    • taterbase
      contestant

      Oh I see!

  • judge

    Very useful. Thanks Remy.

  • contestant

    I like the simplicity. I dislike the idea that it runs an intermediate server, even though I recognize how well it breaks responsibility into a standalone module. Sorry for the low innovation score - chat servers (even though it's your demo not your project) are the quintessential node starter app.

    • supershabam
      contestant

      True chat servers are the basic demo of node. Transparently hacking a 3rd party chat server to work in ie6 isn't though :P

      Thanks for the feedback.

    • Version2beta
      contestant

      So true. It's a bittersweet victory though. Don't you know all the IE6 traffic on the web is devs testing their code against IE6? Seriously you guys did great. Nice polyfill.

    • supershabam
      contestant

      Haha. Hoping we can do a gifsocket and have support for ie4 to dream about how possible realtime was years ago. A more realistic hope is to pretend you have a websocket but actually use a more mobile network friendly transport.

  • contestant

    Printly.pk

    impressive !

  • contestant

    Very kewl! Looking forward for your post-competition release. Great project George & Ian!

  • contestant

    Looks fun. :)

    But then I realized it's basically you have separate process with socket.io-alike running on the server or you rely on third-party relay. Correct?

    It's useful if you have websockets implemented in Java or Python, but if you're developing in node and it will be your only environment, probably not worth it.

    Although I've been looking for similar solution for my sockets API, to be able support mobile native apps.

    All that chatter to explain why it's four stars not five :)

    • supershabam
      contestant

      Right, socket.io-like server set up as a relay, but only used as necessary. Socket.io is difficult to scale, so we're solving scaling the hacky socket.io-like things in the way we're architecting polysocket, which leaves you the easier task of scaling up a websocket server.

      So, I think Nodeists will still like it, plus Python and Java can enjoy too.

      Thanks for the feedback!

    • alexindigo
      contestant

      I'd really like to see polysocket as a library, so I can have native clients speaking to my server in pure websockets and in same time translate older dialects into websockets, without extra process on the server. Like for example Nodejitsu – it's $9/month :) And for small project it's not worth it.

    • supershabam
      contestant

      PolySocket does rely on a relay server to work, but we're open sourcing everything! We do also plan to host and deal with the hacky scale issues. Maybe we could do a free tier for the sake of awesome side projects that just need to work.

    • alexindigo
      contestant

      Cool, can't wait :)

    • taterbase
      contestant

      Thanks for the feedback :)

  • judge

    Applied Geographics

    seems nice but isn't all that well explained, this is different from engine.io how?

    • supershabam
      contestant

      Thanks for the feedback. PolySocket runs independently of your application. So scaling is easier and languages besides NodeJS get first-class citizenship. Plus socket.io/engine.it/sockjs/primus are essentially their own invented standard, whereas WebSockets are standardized.

  • contestant

    i.tv

    Cool stuff! Seems like it works great.

    I don't understand why using pure websockets and having to go through a relay server is better than just good old socket.io, and I don't feel like you explained it beyond "hey, you don't need to use socket.io!" Still, strong stuff.

    • supershabam
      contestant

      Good feedback. PolySocket will use WebSockets if available and connect directly to the target server. The relay is there just in case your browser needs it to complete the polyfill. Thanks for the vote.

  • contestant

IMPORTANT DATES

REGISTRATION
SEP 17
COMPETITION
NOV 9-11 UTC
JUDGING
NOV 11-17
WINNERS
NOV 18

Thank you to our Platinum Sponsors