socket.io
Advanced tools
Comparing version 2.1.1 to 2.2.0
@@ -373,2 +373,3 @@ 'use strict'; | ||
debug('serve client source'); | ||
res.setHeader("Cache-Control", "public, max-age=0"); | ||
res.setHeader('Content-Type', 'application/javascript'); | ||
@@ -375,0 +376,0 @@ res.setHeader('ETag', expectedEtag); |
@@ -265,2 +265,5 @@ | ||
Namespace.prototype.clients = function(fn){ | ||
if(!this.adapter){ | ||
throw new Error('No adapter for this namespace, are you trying to get the list of clients of a dynamic namespace?') | ||
} | ||
this.adapter.clients(this.rooms, fn); | ||
@@ -267,0 +270,0 @@ // reset rooms for scenario: |
{ | ||
"name": "socket.io", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "node.js realtime framework server", | ||
@@ -27,8 +27,8 @@ "keywords": [ | ||
"dependencies": { | ||
"debug": "~3.1.0", | ||
"engine.io": "~3.2.0", | ||
"debug": "~4.1.0", | ||
"engine.io": "~3.3.1", | ||
"has-binary2": "~1.0.2", | ||
"socket.io-adapter": "~1.1.0", | ||
"socket.io-client": "2.1.1", | ||
"socket.io-parser": "~3.2.0" | ||
"socket.io-client": "2.2.0", | ||
"socket.io-parser": "~3.3.0" | ||
}, | ||
@@ -35,0 +35,0 @@ "devDependencies": { |
@@ -14,3 +14,3 @@ | ||
Socket.IO enables real-time bidirectional event-based communication. It consists in: | ||
Socket.IO enables real-time bidirectional event-based communication. It consists of: | ||
@@ -59,6 +59,6 @@ - a Node.js server (this repository) | ||
```js | ||
io.on('connection', function(socket){ | ||
socket.emit('request', /* */); // emit an event to the socket | ||
io.emit('broadcast', /* */); // emit an event to all connected sockets | ||
socket.on('reply', function(){ /* */ }); // listen to the event | ||
io.on('connection', socket => { | ||
socket.emit('request', /* … */); // emit an event to the socket | ||
io.emit('broadcast', /* … */); // emit an event to all connected sockets | ||
socket.on('reply', () => { /* … */ }); // listen to the event | ||
}); | ||
@@ -89,3 +89,3 @@ ``` | ||
```bash | ||
npm install socket.io --save | ||
npm install socket.io | ||
``` | ||
@@ -99,7 +99,7 @@ | ||
```js | ||
var server = require('http').createServer(); | ||
var io = require('socket.io')(server); | ||
io.on('connection', function(client){ | ||
client.on('event', function(data){}); | ||
client.on('disconnect', function(){}); | ||
const server = require('http').createServer(); | ||
const io = require('socket.io')(server); | ||
io.on('connection', client => { | ||
client.on('event', data => { /* … */ }); | ||
client.on('disconnect', () => { /* … */ }); | ||
}); | ||
@@ -112,4 +112,4 @@ server.listen(3000); | ||
```js | ||
var io = require('socket.io')(); | ||
io.on('connection', function(client){}); | ||
const io = require('socket.io')(); | ||
io.on('connection', client => { ... }); | ||
io.listen(3000); | ||
@@ -126,6 +126,6 @@ ``` | ||
```js | ||
var app = require('express')(); | ||
var server = require('http').createServer(app); | ||
var io = require('socket.io')(server); | ||
io.on('connection', function(){ /* … */ }); | ||
const app = require('express')(); | ||
const server = require('http').createServer(app); | ||
const io = require('socket.io')(server); | ||
io.on('connection', () => { /* … */ }); | ||
server.listen(3000); | ||
@@ -140,6 +140,6 @@ ``` | ||
```js | ||
var app = require('koa')(); | ||
var server = require('http').createServer(app.callback()); | ||
var io = require('socket.io')(server); | ||
io.on('connection', function(){ /* … */ }); | ||
const app = require('koa')(); | ||
const server = require('http').createServer(app.callback()); | ||
const io = require('socket.io')(server); | ||
io.on('connection', () => { /* … */ }); | ||
server.listen(3000); | ||
@@ -146,0 +146,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55917
1452
+ Addedcomponent-emitter@1.3.1(transitive)
+ Addeddebug@4.1.1(transitive)
+ Addedengine.io@3.3.2(transitive)
+ Addedengine.io-client@3.3.3(transitive)
+ Addedms@2.1.3(transitive)
+ Addedsocket.io-client@2.2.0(transitive)
+ Addedsocket.io-parser@3.3.4(transitive)
+ Addedws@6.1.4(transitive)
+ Addedxmlhttprequest-ssl@1.6.3(transitive)
- Removedengine.io@3.2.1(transitive)
- Removedengine.io-client@3.2.1(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsocket.io-client@2.1.1(transitive)
- Removedsocket.io-parser@3.2.0(transitive)
- Removedultron@1.1.1(transitive)
- Removedws@3.3.3(transitive)
- Removedxmlhttprequest-ssl@1.5.5(transitive)
Updateddebug@~4.1.0
Updatedengine.io@~3.3.1
Updatedsocket.io-client@2.2.0
Updatedsocket.io-parser@~3.3.0