Skip to content

Instantly share code, notes, and snippets.

@rauchg
Created November 21, 2012 12:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rauchg/cb68fe1460fa42636242 to your computer and use it in GitHub Desktop.
Save rauchg/cb68fe1460fa42636242 to your computer and use it in GitHub Desktop.
Socket.IO / Engine.IO

Overview

Socket.IO is a Node.JS framework that enables the creation of realtime web applications in all browsers, mobile devices and servers. Through its transport Engine.IO, it lets app creators perform server "push" to drastically reduce latency, while making sure your application works despite the capabilities of the network of user agent.

More about Socket.IO: http://socket.io
More about Engine.IO: http://github.com/learnboost/engine.io
More about Node.JS: http://node.js

Objectives

Socket.IO has become one of the most prominent flagship projects of Node.JS, the V8-based environment that allows for writing event-based servers in pure JavaScript. It's one of the most followed projects on GitHub, and it has a thriving community.

Many interesting and unique challenges have arisen that we can tackle together.

Continuos automatic browser/mobile testing

Engine.IO mimics the API of HTML5 WebSockets, a relatively new HTML5 API that brings TCP to the browser. Due to the widespread usage of broken browsers (including IE9) and outdated proxies, servers (like Apache) and other backend middleware, Engine.IO has been designed to support multiple transports, even though itself is the transport for Socket.IO.

It's imperative that for every major software release each transport is thoroughly tested in supporting browsers and devices. However, at the moment this is a manual process.

What this entails

Taking on this task would involve writing an adaptor for our test framework (mocha) that transports tests to BrowserStack, which has provided free accounts for this project. BrowserStack will allows us to run our test cases in the cloud and report back results to the terminal in realtime.

Clients and servers for all backends

The community has taken the project beyond Node.JS and JavaScript and created servers and clients for a variety of different languages and frameworks.

Right now it's hard to find them from the main website, and sometimes there exist competing versions that make it hard to decide which is the most suitable.

Documenting, listing and writing Engine.IO and Socket.IO clients for most major backend technologies is paramount to the continued success of the project. This includes:

  • Python
  • Ruby
  • Java + Android
  • ObjectiveC + iOS
  • Flash

What this entails

After picking a given technology, researching the existing solutions is the first step. Most likely, someone already has made Socket.IO work there. The next step is to make sure that the solution works in a performance and bug-free way with the latest version of the Engine.IO and Socket.IO protocols. If not, we would review whether we fork or write a new version from scratch.

Continuous automatic benchmarking

The project has several key areas that are ripe for optimization:

  • The protocol parser
  • HTTP requests handling
  • Browser client

Even though Socket.IO has really good performance, it's hard to tell if we're regressing or improving. We also are not able to tell easily what impact upgrading Node.JS or V8 has on our code, and what measures need to be taken.

What this entails

Inspired by JSPerf and similarly to our browser testing approach, the idea is to write a set of benchmarks that target the specific concerning areas, and have them run automatically for every commit on GitHub. Some of these benchmarks will be executed on the server, and some need to be executed in the cloud on browsers and mobile devices. The result should be a simple report and all the data needs to be saved down for future analysis.

Contacts

Guillermo Rauch (rauchg@gmail.com)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment