"readme":"\n# socket.io-client\n\n[](http://travis-ci.org/Automattic/socket.io-client)\n[](http://badge.fury.io/js/socket.io-client)\n\n\n## How to use\n\nA standalone build of `socket.io-client` is exposed automatically by the\nsocket.io server as `/socket.io/socket.io.js`. Alternatively you can\nserve the file `socket.io.js` found at the root of this repository.\n\n```html\n<script src=\"/socket.io/socket.io.js\"></script>\n<script>\n var socket = io('http://localhost');\n socket.on('connect', function(){\n socket.on('event', function(data){});\n socket.on('disconnect', function(){});\n });\n</script>\n```\n\nSocket.IO is compatible with [browserify](http://browserify.org/).\n\n### Node.JS (server-side usage)\n\n Add `socket.io-client` to your `package.json` and then:\n\n ```js\n var socket = require('socket.io-client')('http://localhost');\n socket.on('connect', function(){\n socket.on('event', function(data){});\n socket.on('disconnect', function(){});\n });\n ```\n\n## API\n\n### IO(url:String, opts:Object):Socket\n\n Exposed as the `io` namespace in the standalone build, or the result\n of calling `require('socket.io-client')`.\n\n When called, it creates a new `Manager` for the given URL, and attempts\n to reuse an existing `Manager` for subsequent calls, unless the\n `multiplex` option is passed with `false`.\n\n The rest of the options are passed to the `Manager` constructor (see below\n for details).\n\n A `Socket` instance is returned for the namespace specified by the\n pathname in the URL, defaulting to `/`. For example, if the `url` is\n `http://localhost/users`, a transport connection will be established to\n `http://localhost` and a Socket.IO connection will be established to\n `/users`.\n\n### IO#protocol\n\n Socket.io protocol revision number this client works with.\n\n### IO#Socket\n\n Reference to the `Socket` constructor.\n\n### IO#Manager\n\n Reference to the `Manager` constructor.\n\n### IO#Emitter\n\n Reference to the `Emitter` constructor.\n\n### Manager(url:String, opts:Object)\n\n A `Manager` represents a connection to a given Socket.IO server. One or\n more `Socket` instances are associated with the manager. The manager\n can be accessed through the `io` property of each `Socket` instance.\n\n The `opts` are also passed to `engine.io` upon initialization of the\n underlying `Socket`.\n\n Options:\n - `reconnection` whether to reconnect automatically (`true`)\n - `reconnectionDelay` how long to wait before attempting a new\n reconnection (`1000`)\n - `reconnectionDelayMax` maximum amount of time to wait between\n reconnections (`5000`). Each attempt increases the reconnection by\n the amount specified by `reconnectionDelay`.\n - `timeout` connection timeout before a `connect_error`\n and `connect_timeout` events are emitted (`20000`)\n - `autoConnect` by setting this false, you have to call `manager.open`\n whenever you decide it's appropriate\n\n#### Events\n\n - `connect`. Fired upon a successful connection.\n - `connect_error`. Fired upon a connection error.\n Parameters:\n - `Object` error object\n - `connect_timeout`. Fired upon a connection timeout.\n - `reconnect`. Fired upon a successful reconnection.\n Parameters:\n - `Number` reconnection attempt number\n - `reconnect_attempt`. Fired upon an attempt to reconnect.\n - `reconnecting`. Fired upon an attempt to reconnect.\n Parameters:\n - `Number` reconnection attempt number\n - `reconnect_error`. Fired upon a reconnection attempt error.\n Parameters:\n - `Object` error object\n - `reconnect_failed`. Fired when couldn't reconnect within `reconnectionAttempts`\n\nThe events above are also emitted on the individual sockets that\nreconnect that depend on this `Manager`.\n\n### Manager#reconnection(v:Boolean):Manager\n\n Sets the `reconnection` option, or returns it if no parameters\n are passed.\n\n### Manager#reconnectionAttempts(v:Boolean):Manager\n\n Sets the `reconnectionAttempts` option, or returns it if no parameters\n are passed.\n\n### Manager#reconnectionDelay(v:Boolean):Manager\n\n Sets the `reconectionDelay` option, or returns it if no parameters\n are passed.\n\n### Manager#reconnectionDelayMax(v:Boolean):Manager\n\n Sets the `reconectionDelayMax` option, or returns it if no parameters\n are passed.\n\n### Manager#timeout(v:Boolean):Manager\n\n Sets the `timeout` option, or returns it if no parameters\n are passed.\n\n### Socket\n\n#### Events\n\n - `connect`. Fired upon connecting.\n - `error`. Fired upon a connection error\n Parameters:\n - `Object` error data\n - `disconnect`. Fired upon a disconnection.\n - `reconnect`. Fired upon a successful reconnection.\n Parameters:\n - `Number` reconnection attempt number\n - `reconnect_attempt`. Fired upon an attempt to reconnect.\n - `reconnecting`. Fired upon an attempt to reconnect.\n Parameters:\n - `Number` reconnection attempt number\n - `reconnect_error`. Fired upon a reconnection attempt error.\n Parameters:\n - `Object` error object\n - `reconnect_failed`. Fired when couldn't reconnect within `reconnectionAttempts`\n\n## License\n\nMIT\n",