Skip to content

confirmedcode/Bandwidth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bandwidth Throttling Script (Runs on VPN Server)

Right before a VPN client is connected, the Node.js script bandwidth/index.js runs to ask the Helper Server whether or not to throttle that client, and if so, throttles the client using tc. Throttling occurs when a user does not have an active subscription, or uses excessive bandwidth.

How It Works

This script is deployed to every VPN server. It is triggered by the Updown StrongSwan plugin, which allows a custom script to run every time a connection is established or disconnected.

  1. VPN Client Connects Updown triggers bandwidth/index.js and passes in client_id environment variable.

  2. bandwidth/index.js does a GET on the private network to Helper to check for throttling

http://helper.[environment]-private/bandwidth-restriction?client_id=[clientId]

  1. Response from Helper
{
	ratelimitkbps: 10000
}
  1. If ratelimitkbps is undefined or null, don't throttle. Otherwise, use tc to throttle the client_id.

  2. VPN Client Disconnects Updown triggers bandwidth/index.js, which removes any throttle of the client_id.

Feedback

If you have any questions, concerns, or other feedback, please let us know any feedback in Github issues or by e-mail.

We also have a bug bounty program -- please email [email protected] for details.

License

This project is licensed under the GPL License - see the LICENSE.md file for details

Contact

[email protected]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published