
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
testing-https-server
Advanced tools
A simple HTTPS static file server with built-in self-signed certificates for testing purposes. Similar to http-server but provides HTTPS functionality out of the box.
A simple HTTPS static file server with built-in self-signed certificates for testing purposes. Similar to http-server but provides HTTPS functionality out of the box.
npm install
# Serve current directory on default port (8443)
npx https-server
# Serve specific directory
npx https-server ./public
# Custom port
npx https-server -p 9000
# Enable caching for 1 hour
npx https-server -c 3600
# Disable CORS
npx https-server --no-cors
# Bind to different address
npx https-server -a 0.0.0.0
# Silent mode (minimal output)
npx https-server -s
# Open browser automatically (requires 'opener' package)
npx https-server -o
const HttpsServer = require('./index');
const server = new HttpsServer({
port: 8443,
directory: './public',
host: 'localhost',
cors: true,
cache: 3600
});
server.start()
.then(() => {
console.log('Server started successfully!');
})
.catch((err) => {
console.error('Failed to start server:', err);
});
| Option | Short | Default | Description |
|---|---|---|---|
--port | -p | 8443 | Port to listen on |
--address | -a | localhost | Address to bind to |
--cache | -c | -1 | Cache time in seconds (-1 disables caching) |
--no-cors | Disable CORS headers | ||
--open | -o | Open browser after starting | |
--silent | -s | Suppress log messages | |
--help | -h | Show help information |
⚠️ Important: This server uses self-signed certificates for testing purposes only.
When you visit https://localhost:8443 (or your chosen port), your browser will show a security warning. This is expected behavior. To proceed:
Never use these certificates in production!
# Create some test files
mkdir my-site
echo '<h1>Hello HTTPS!</h1>' > my-site/index.html
echo '<h2>About Page</h2>' > my-site/about.html
# Serve the site
npx https-server my-site
# Visit https://localhost:8443
# For SPAs, all routes will fallback to index.html
npx https-server ./dist
# Perfect for React, Vue, Angular apps
# Enable caching for assets but not HTML
npx https-server -c 0 ./build
# Bind to all interfaces (be careful!)
npx https-server -a 0.0.0.0 -p 8443
{
port: 8443, // Port number
directory: '.', // Directory to serve
host: 'localhost', // Host to bind to
cors: true, // Enable CORS headers
cache: -1 // Cache time in seconds (-1 = no cache)
}
start() - Returns a Promise that resolves when server startsstop() - Returns a Promise that resolves when server stops gracefully# Check what's using the port
npx https-server -p 9000
# Use a port > 1024 or run with sudo (not recommended)
npx https-server -p 8443
https:// not http://MIT
Happy serving! 🚀
FAQs
A simple HTTPS static file server with built-in self-signed certificates for testing purposes. Similar to http-server but provides HTTPS functionality out of the box.
We found that testing-https-server demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.