
Product
Introducing Supply Chain Attack Campaigns Tracking in the Socket Dashboard
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.
Run multiple http servers that share a port file and does automatic failover if the server listening on the port crashes
Similar in scope to level-party but for http. Allows you to run multiple http servers that share a port file and does automatic failover if the server listening on the port crashes.
npm install http-party
var party = require('http-party');
party('./PORT', // './PORT' is the port file the servers will use to coordinate.
function onserver(server) {
server.on('request', function(request, response) {
response.end('hello world from '+pid);
})
},
function ready(err, port) {
console.log('Someone is listening on', port);
}
);
The PORT file defaults to ./PORT.
Try running the above example in a folder and spawn multiple processes.
cd some-dir
node example.js &
node example.js &
node example.js &
node example.js &
node example.js
The processes should print the same port. Try curling to that port
curl http://127.0.0.1:PORT
This should print the pid of a process. Try killing that process.
kill PID
If you curl the same url again one of the other processes will be listening instead!
You can always cat the PORT file to figure out which port is being used.
Also since we use a regular file instead of unix sockets this should also work on windows!
If you already have a server just pass than instead of the onserver function
var server = http.createServer(function(req, res) {
res.end('hello world\n')
})
server.on('listening', function() {
console.log('Server has started')
})
party('./PORT', server, function(err, port) {
console.log('Someone is listening on', port);
})
MIT
FAQs
Run multiple http servers that share a port file and does automatic failover if the server listening on the port crashes
We found that http-party 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.

Product
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.

Research
Malicious PyPI package sympy-dev targets SymPy users, a Python symbolic math library with 85 million monthly downloads.

Security News
Node.js 25.4.0 makes require(esm) stable, formalizing CommonJS and ESM compatibility across supported Node versions.