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.
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.
-
VPN Client Connects
Updown
triggersbandwidth/index.js
and passes inclient_id
environment variable. -
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]
- Response from Helper
{
ratelimitkbps: 10000
}
-
If
ratelimitkbps
is undefined or null, don't throttle. Otherwise, usetc
to throttle theclient_id
. -
VPN Client Disconnects
Updown
triggersbandwidth/index.js
, which removes any throttle of theclient_id
.
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.
This project is licensed under the GPL License - see the LICENSE.md file for details