Namespace#name

Namespace#name:String The namespace identifier property.

Client#request

Client#request A getter proxy that returns the reference to the request that originated the engine.io connection. Useful for accessing request headers such as Cookie or User-Agent.

Server#of

Server#of(nsp:String):Namespace Initializes and retrieves the given Namespace by its pathname identifier nsp. If the namespace was already initialized it returns it right away.

IO#Manager

IO#Manager Reference to the Manager constructor.

Socket#client

Socket#client:Client A reference to the underlying Client object.

Socket#id

Socket#id:String A unique identifier for the socket session, that comes from the underlying Client.

Socket

Socket A Socket is the fundamental class for interacting with browser clients. A Socket belongs to a certain Namespace (by default /) and uses an underlying Client to communicate.

Namespace#use

Namespace#use(fn:Function):Namespace Registers a middleware, which is a function that gets executed for every incoming Socket and receives as parameter the socket and a function to optionally defer execution to the next registered middleware. var io = require('socket.io')(); io.use(function(socket, next){ if (socket.request.headers.cookie) return next(); next(new Error('Authentication error')); }); Errors passed to middleware callbacks are sent as special error packets to clients.

Logging and Debugging

Socket.IO is now completely instrumented by a minimalistic yet tremendously powerful utility called debug by TJ Holowaychuk. Before 1.0, the Socket.IO server would default to logging everything out to the console. This turned out to be annoyingly verbose for many users (although extremely useful for others), so now we default to being completely silent by default. The basic idea is that each module used by Socket.IO provides different debugging scopes that give you insight into the internals. B

IO

IO(url:String, opts:Object):Socket Exposed as the io global in window if using the standalone build (eg: /socket.io/socket.io.js or the CDN), or the result of calling require('socket.io-client'). When called, it creates a new Manager for the given URL, and attempts to reuse an existing Manager for subsequent calls, unless the multiplex option is passed with false. Passing this option is the equivalent of passing 'force new connection': true. The rest of the options are passed to the Manager con