Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
node-multi-socketservers
Advanced tools
A multi http & socket servers manager, based on node-multi-webserver
A multi http & socket servers manager, based on node-multi-webserver
$ npm install node-multi-socketservers
see node-multi-webservers documentation for webservers management
connection(function eventListener) : return Promise instance
eventListener((socket[ , server ]) => {})
emit(string eventName[, mixed data]) : return Promise instance
broadcast(SocketIO.Socket socket, http.Server server, string eventName, [, mixed data]) : return Promise instance
broadcast on all servers
const http = require("http"),
https = require("https"),
express = require("express"),
multiservers = require("node-multi-socketservers");
let servers = new multiservers(),
app = express().get("/", (req, res) => {
res.set("Content-Type", contentType).send(message);
});
return servers.addServer({
port: 80,
name: "http server"
}).then(() => {
return servers.addServer({
port: 443,
name: "secure server",
ssl: true,
key: "YOUR_PRIVATE_KEY",
cert: "YOUR_CERTIFICATE"
});
}).then(() => {
return servers.addServer({
port: 1337,
name: "admin server",
key: "YOUR_PRIVATE_KEY",
cert: "YOUR_CERTIFICATE"
});
}).then(() => {
return servers.setTimeout(2 * 1000);
}).then(() => {
return servers.listen(app);
}).then(() => {
return servers.connection((socket, server) => {
servers.broadcast(socket, server, "newconnection");
socket.on("disconnect", () => {
servers.broadcast(socket, server, "disconnection");
});
});
}).catch((err) => {
console.log(err);
servers.release().catch((err) => {
console.log(err);
});
});
const http = require("http"),
https = require("https"),
multiservers = require("node-multi-socketservers");
let servers = new multiservers();
return servers.addServer({
port: 80,
name: "http server"
}).then(() => {
return servers.addServer({
port: 443,
name: "secure server",
ssl: true,
key: "YOUR_PRIVATE_KEY",
cert: "YOUR_CERTIFICATE"
});
}).then(() => {
return servers.addServer({
port: 1337,
name: "admin server",
key: "YOUR_PRIVATE_KEY",
cert: "YOUR_CERTIFICATE"
});
}).then(() => {
return servers.setTimeout(2 * 1000);
}).then(() => {
return servers.listen((req, res) => {
res.writeHead(200, {"Content-Type": contentType});
res.end("hello world, from http:80, https:443 or https:1337");
});
}).then(() => {
return servers.connection((socket, server) => {
servers.broadcast(socket, server, "newconnection");
socket.on("disconnect", () => {
servers.broadcast(socket, server, "disconnection");
});
});
}).catch((err) => {
console.log(err);
servers.release().catch((err) => {
console.log(err);
});
});
$ gulp
FAQs
A multi http & socket servers manager, based on node-multi-webserver
We found that node-multi-socketservers 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.