New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

express.oi

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express.oi - npm Package Compare versions

Comparing version

to
0.0.19

10

package.json
{
"name": "express.oi",
"version": "0.0.18",
"version": "0.0.19",
"description": "Realtime-web library, based on express and socket.io",

@@ -21,7 +21,7 @@ "keywords": [

"dependencies": {
"async": "^0.9.0",
"cookie-parser": "~1.3.4",
"async": "^1.0.0",
"cookie-parser": "^1.3.5",
"express": "^4.12.3",
"express-session": "~1.10.4",
"lodash": "^3.6.0",
"express-session": "~1.11.2",
"lodash": "^3.9.1",
"socket.io": "^1.3.5"

@@ -28,0 +28,0 @@ },

@@ -42,4 +42,7 @@ ![express.oi](http://i.imgur.com/zzZLudd.png)

// Pass in your express-session configuration
// Documentation here: https://github.com/expressjs/session#sessionoptions
app.io.session({
secret: 'express.oi makes me happy'
secret: 'express.oi makes me happy',
resave: false,
saveUninitialized: true
});

@@ -119,18 +122,17 @@

// You can check if current request is a websocket
if (!req.isSocket) {
return;
}
if (req.isSocket) {
// Emit event to current socket
req.socket.emit('message', 'this is a test');
// Emit event to current socket
req.socket.emit('message', 'this is a test');
// Emit event to all clients except sender
req.socket.broadcast.emit('message', 'this is a test');
// Emit event to all clients except sender
req.socket.broadcast.emit('message', 'this is a test');
// sending to all clients in 'game' room(channel) except sender
req.socket.broadcast.to('game').emit('message', 'nice game');
// sending to all clients in 'game' room(channel) except sender
req.socket.broadcast.to('game').emit('message', 'nice game');
// sending to individual socketid, socketid is like a room
req.socket.broadcast.to(socketId).emit('message', 'for your eyes only');
// sending to individual socketid, socketid is like a room
req.socket.broadcast.to(socketId).emit('message', 'for your eyes only');
}

@@ -137,0 +139,0 @@ // sending to all clients, including sender