New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

chokepoint

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chokepoint

Node.js load balancer

latest
Source
npmnpm
Version
1.7.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Chokepoint

Chokepoint is a powerful Node.js package designed to streamline HTTP/HTTPS load balancing in your applications. It distributes incoming traffic across multiple nodes using Round Robin algorithm, ensuring optimal resource utilization and enhanced performance.

NPM npm GitHub contributors GitHub last commit (branch) npm

HTTP load balancing

import Chokepoint from "chokepoint";

const nodes = [
  { host: "localhost", port: 8001 },
  { host: "localhost", port: 8002 },
  { host: "localhost", port: 8003 },
];
const chokepoint = new Chokepoint(nodes);

chokepoint.listen(80, () => {
  console.log("Load balancer is running");
});

HTTPS load balancing

import Chokepoint from "chokepoint";

const nodes = [
  { host: "localhost", port: 8001 },
  { host: "localhost", port: 8002 },
  { host: "localhost", port: 8003 },
];
const chokepoint = new Chokepoint(nodes);

// Configure SSL certificate before listen
chokepoint.secure({
  key: fs.readFileSync("./ssl-key.pem"),
  cert: fs.readFileSync("./ssl-cert.pem"),
});

chokepoint.listen(443, () => {
  console.log("Secure load balancer is running");
});

Enable CORS

import Chokepoint from "chokepoint";

const nodes = [
  { host: "localhost", port: 8001 },
  { host: "localhost", port: 8002 },
  { host: "localhost", port: 8003 },
];
const chokepoint = new Chokepoint(nodes);

// Enable CORS for your request origins before listen
chokepoint.cors(["https://example.com"]);

chokepoint.listen(80, () => {
  console.log("Load balancer is running");
});

🚀 Excited to kickstart this project! Your support means the world to us. Please give us a star ⭐️ on GitHub to show your encouragement and help us grow! Let's build something amazing together! 🌟

Keywords

load balance

FAQs

Package last updated on 12 Nov 2023

Did you know?

Socket

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.

Install

Related posts