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.

Server#serveClient

Server#serveClient(v:Boolean):Server If v is true the attached server (see Server#attach) will serve the client files. Defaults to true. This method has no effect after attach is called. // pass a server and the `serveClient` option var io = require('socket.io')(http, { serveClient: false }); // or pass no server and then you can call the method var io = require('socket.io')(); io.serveClient(false); io.attach(http); If no arguments are supplied this method returns the current value.

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

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#Socket

IO#Socket Reference to the Socket constructor.

Namespace

Namespace Represents a pool of sockets connected under a given scope identified by a pathname (eg: /chat). By default the client always connects to /. Events connection / connect. Fired upon a connection. Parameters: Socket the incoming socket.

IO#protocol

IO#protocol Socket.io protocol revision number this client works with.

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#use

Server#use See Namespace#use below.

Server#bind

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