Namespace#name

Namespace#name:String The namespace identifier property.

IO#Socket

IO#Socket Reference to the Socket constructor.

Server#listen

Server#listen Synonym of Server#attach.

Socket#emit

Socket#emit(name:String[, …]):Socket Emits an event to the socket identified by the string name. Any other parameters can be included. All datastructures are supported, including Buffer. JavaScript functions can’t be serialized/deserialized. var io = require('socket.io')(); io.on('connection', function(socket){ socket.emit('an event', { some: 'data' }); });

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

Client

Client The Client class represents an incoming transport (engine.io) connection. A Client can be associated with many multiplexed Socket that belong to different Namespaces.

Server#bind

Server#bind(srv:engine#Server):Server Advanced use only. Binds the server to a specific engine.io Server (or compatible API) instance.

Socket#leave

Socket#leave(name:String[, fn:Function]):Socket Removes the socket from room, and fires optionally a callback fn with err signature (if any). Rooms are left automatically upon disconnection. The mechanics of leaving rooms are handled by the Adapter that has been configured (see Server#adapter above), defaulting to socket.io-adapter.

Manager#timeout

Manager#timeout(v:Boolean):Manager Sets the timeout option, or returns it if no parameters are passed.

Socket#in

Socket#in(room:String):Socket Sets a modifier for a subsequent event emission that the event will only be broadcasted to sockets that have joined the given room. To emit to multiple rooms, you can call to several times. var io = require('socket.io')(); io.on('connection', function(socket){ socket.to('others').emit('an event', { some: 'data' }); });