
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
multisite-handler
Advanced tools
Route http requests to different handler functions based on hostname of the incomming request
A simple library for routing an incomming message to different handlers based on the hostname in the request's Host header.
const http = require('http');
const multisite = require('multisite-hander');
const siteOne = (req, res) => res.end('Welcome to kittens.example, home of kitten things!')
const siteTwo = (req, res) => res.end('Welcome to anarchism.example, home of anarchist things!')
// Provide a dict object to map your domain names to site handlers
const handler = multisite({
'kittens.example': siteOne,
'anarchism.example': siteTwo
})
http.createServer(handler).listen(1234);
Also accepts an async function instead of a dict, so you can write more complex matchers (or even something async like looking names up in a database).
const handler = multisite(hostname => {
// If the host header has a port specified, it will be stripped before this function is called
if(hostname.match(/\bkittens\.example$/)) {
return kittenSite;
}
})
FAQs
Route http requests to different handler functions based on hostname of the incomming request
The npm package multisite-handler receives a total of 0 weekly downloads. As such, multisite-handler popularity was classified as not popular.
We found that multisite-handler 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
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.