This project demonstrates how to set up an HTTPS server in Node.js with SSL/TLS support, clustering to utilize multiple CPU cores, and error handling.
- HTTPS server with SSL/TLS encryption.
- Clustering support to use all available CPU cores for better performance.
- Graceful error handling to avoid crashing on uncaught exceptions or unhandled rejections.
Before running the server, you need to have the following:
- Node.js installed (version 12 or higher recommended).
- A valid SSL certificate (
cert.pem) and private key (key.pem).
-
Clone this repository:
git clone https://github.com/NetroIndonesia/https.js.git
-
Navigate to the project directory:
cd https.js -
Install necessary dependencies (if applicable):
npm install
-
Place your SSL certificate and private key in a
cert/directory:cert/key.pem: Your private key file.cert/cert.pem: Your certificate file.
To start the server, run the following command:
node index.jsJoin me on Telegram.