
Product
Introducing the Alert Details Page: A Better Way to Explore Alerts
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.
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 cwd/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!
MIT
FAQs
Run multiple http servers that share a port file and does automatic failover if the server listening on the port crashes
The npm package http-party receives a total of 0 weekly downloads. As such, http-party popularity was classified as not popular.
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
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.

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.