66 lines
12 KiB
JSON
66 lines
12 KiB
JSON
|
{
|
||
|
"name": "socket.io",
|
||
|
"version": "1.3.5",
|
||
|
"description": "node.js realtime framework server",
|
||
|
"keywords": [
|
||
|
"realtime",
|
||
|
"framework",
|
||
|
"websocket",
|
||
|
"tcp",
|
||
|
"events",
|
||
|
"socket",
|
||
|
"io"
|
||
|
],
|
||
|
"repository": {
|
||
|
"type": "git",
|
||
|
"url": "git://github.com/Automattic/socket.io"
|
||
|
},
|
||
|
"scripts": {
|
||
|
"test": "mocha --reporter dot --slow 200ms --bail"
|
||
|
},
|
||
|
"dependencies": {
|
||
|
"engine.io": "1.5.1",
|
||
|
"socket.io-parser": "2.2.4",
|
||
|
"socket.io-client": "1.3.5",
|
||
|
"socket.io-adapter": "0.3.1",
|
||
|
"has-binary-data": "0.1.3",
|
||
|
"debug": "2.1.0"
|
||
|
},
|
||
|
"devDependencies": {
|
||
|
"mocha": "1.16.2",
|
||
|
"expect.js": "0.3.1",
|
||
|
"supertest": "0.8.2",
|
||
|
"superagent": "0.17.0",
|
||
|
"istanbul": "0.2.3"
|
||
|
},
|
||
|
"contributors": [
|
||
|
{
|
||
|
"name": "Guillermo Rauch",
|
||
|
"email": "rauchg@gmail.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "Arnout Kazemier",
|
||
|
"email": "info@3rd-eden.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "Vladimir Dronnikov",
|
||
|
"email": "dronnikov@gmail.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "Einar Otto Stangvik",
|
||
|
"email": "einaros@gmail.com"
|
||
|
}
|
||
|
],
|
||
|
"readme": "\n# socket.io\n\n[![Build Status](https://secure.travis-ci.org/Automattic/socket.io.svg)](http://travis-ci.org/Automattic/socket.io)\n![NPM version](https://badge.fury.io/js/socket.io.svg)\n![Downloads](http://img.shields.io/npm/dm/socket.io.svg?style=flat)\n\n## How to use\n\nThe following example attaches socket.io to a plain Node.JS\nHTTP server listening on port `3000`.\n\n```js\nvar server = require('http').createServer();\nvar io = require('socket.io')(server);\nio.on('connection', function(socket){\n socket.on('event', function(data){});\n socket.on('disconnect', function(){});\n});\nserver.listen(3000);\n```\n\n### Standalone\n\n```js\nvar io = require('socket.io')();\nio.on('connection', function(socket){});\nio.listen(3000);\n```\n\n### In conjunction with Express\n\nStarting with **3.0**, express applications have become request handler\nfunctions that you pass to `http` or `http` `Server` instances. You need\nto pass the `Server` to `socket.io`, and not the express application\nfunction.\n\n```js\nvar app = require('express')();\nvar server = require('http').createServer(app);\nvar io = require('socket.io')(server);\nio.on('connection', function(){ /* … */ });\nserver.listen(3000);\n```\n\n### In conjunction with Koa\n\nLike Express.JS, Koa works by exposing an application as a request\nhandler function, but only by calling the `callback` method.\n\n```js\nvar app = require('koa')();\nvar server = require('http').createServer(app.callback());\nvar io = require('socket.io')(server);\nio.on('connection', function(){ /* … */ });\nserver.listen(3000);\n```\n\n## API\n\n### Server\n\n Exposed by `require('socket.io')`.\n\n### Server()\n\n Creates a new `Server`. Works with and without `new`:\n\n ```js\n var io = require('socket.io')();\n // or\n var Server = require('socket.io');\n var io = new Server();\n ```\n\n### Server(opts:Object)\n\n Optionally, the first or second argument (see below) of the `Server`\n constructor can be an options object.\n\n The following options are supported:\n\n - `serveClient` sets the value for Server#serveClient()\n - `path` sets the value for Server#path()\n\n The same options passed to socket.io are always passed to\n the `engine.io` `Server` that gets created. See engine.io\n [options](https://github.com/learnboost/engine.io#methods-1)\n as reference.\n\n### Server(srv:http#Server, opts:Object)\n\n Creates a new `Server` and attaches it to the given `srv`. Optionally\n `opts` can be passed.\n\n### Server(port:Number, opts:Object)\n\n Binds socket.io to a new `http.Server` that listens on `port`.\n\n### Server#serveClient(v:Boolean):Server\n\n If `v` is `true` the attached server (see `Server#attach`) will serve\n the client files. Defaults to `true`.\n\n This method has no effect after `attach` is called.\n\n ```js\n // pass a server and the `serveClient` option\n var io = require('socket.io')(http, { serveClient: false });\n\n // or pass no server and then you can call the method\n var io = require('socket.io')();\n io.serveClient(false);\n io.attach(http);\n ```\n\n If no arguments are supplied this method returns the current value.\n\n### Server#path(v:String):Server\n\n Sets the path `v` under which `engine.io` and the static files will be\n served. Defaults to `/socket.io`.\n\n If no arguments are supplied this method returns the current value.\n\n### Server#adapter(v:Adapter):Server\n\n Sets the adapter `v`. Defaults to an instance of the `Adapter` that\n ships with socket.io which is memory based. See\n [socket.io-adapter](https://github.com/Automattic/socket.io-adapter).\n\n If no arguments are supplied this method returns the current value.\n\n### Server#origins(v:String):Server\n\n Sets the allowed origins `v`. Defaults to any origins being allowed.\n\n If no arguments are supplied this method returns the current value.\n\n### Server#origins(v:Function):Server\n\n Sets the allowed origins as dynamic function. Function takes two arguments `origin:String` and `callback(error, success)`, where `success` is a bo
|
||
|
"readmeFilename": "Readme.md",
|
||
|
"bugs": {
|
||
|
"url": "https://github.com/Automattic/socket.io/issues"
|
||
|
},
|
||
|
"_id": "socket.io@1.3.5",
|
||
|
"dist": {
|
||
|
"shasum": "0757919c21bd369a84e9d7257f3958cd472a9d15"
|
||
|
},
|
||
|
"_from": "socket.io@",
|
||
|
"_resolved": "https://registry.npmjs.org/socket.io/-/socket.io-1.3.5.tgz"
|
||
|
}
|