
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
sse.io-server-nodejs
Advanced tools
NodeJS server for SSE-IO.
const sseio = require('sse.io-server-nodejs')
Import using ES6
import * as sseio from 'sse.io-server-nodejs';
The following example attaches sse.io to a plain Node.JS HTTP server listening on port 3000.
const server = http.createServer();
const sseServer = sseio.newServer(server, { path: '/user/:userId/foo' });
const eventHandler = sseServer.registerEventHandler('event', {
getRoomId: (context): string => {
return context.params.guid;
},
});
server.listen(3000);
eventHandler.send('roomId', 'message');
const sseServer = sseio.newServer({ path: '/user/:userId/foo' });
// ... regist event handler
sseServer.listen(3000);
const app = new require('koa')();
const server = require('http').createServer(app.callback());
const sseServer = sseio.newServer(server, {
path: '/files/:fileGuid/pull'
})
// ... regist event handler
server.listen(3000);
const app = require('express')();
const server = require('http').createServer(app);
const sseServer = sseio.newServer(server, {
path: '/files/:fileGuid/pull'
})
// ... regist event handler
server.listen(3000);
httpServer http.Server The server to bind to.options (Object)
path (String) The url path. You can add path params as well like /users/:userId.Serveroptions (Object) See above for available options.ServerUsually using for standalone mode.
event (String) The event you want to handle.options (Object)
getRoomId (Function) (context: sseContext) => string Return the room ID.fetch (Function, Optional) (context: sseContext) => Promise<any> It will be executed once after a client is connected, and send the result to the clientEventHandlerport (Number) the port to listen onStarts the HTTP server listening for connections, usually using for standalone mode.
Register a handler for the event. The 'error' event must be handled.
Event: 'conn:create'
callback (Function) The clientId will be passed to the callback functionFired when a new connection is established.
sseServer.on('conn:create', clientId => {
console.log(clientId);
})
Event: 'conn:close'
callback (Function) The clientId will be passed to the callback functionFired when a connection is closed.
Event: 'error'
callback (Function) an Error will be passed to the callback functionFired when an error occurs.
sseServer.on('error', err => {
console.error(err);
})
It's an object containing params and query keys.
params The path params parse from urlquery The query params parse from urlroomId (String) Room idmessage (any) Message be to send. It can be any type. If it's not a string, then it will be stringify by JSON.stringify().Send a message to the clients in room.
Register a handler for the event.
Event: 'room:create'
callback (Function) The roomId will be passed to the callback functionFired when a room is created.
eventHandler.on('room:create', roomId => {
console.log('a room:', roomId, 'has been created');
})
Event: 'room:empty'
callback (Function) The roomId will be passed to the callback functionFired when a room is empty.
FAQs
NodeJS server for SSE-IO
We found that sse.io-server-nodejs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.