Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sltc

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sltc - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

1

bin/sltc.js

@@ -20,3 +20,2 @@ #!/usr/bin/env node

console.log(' --remove Remove tc current rules');
console.log(' --sudo Use sudo for commands');
} else {

@@ -23,0 +22,0 @@ if (!hasbin.all.sync(['tc'])) {

32

lib/sltc.js

@@ -15,24 +15,24 @@ 'use strict';

const setupScripts = [
'sudo tc qdisc add dev %s handle 1: root htb',
'sudo tc filter add dev %s protocol ip prio 1 u32 match ip dport 80 0xffff flowid 1:11',
];
const rateScripts = [
'sudo tc class add dev %s parent 1: classid 1:11 htb rate %s',
];
const delayLossScripts = [
'sudo tc qdisc add dev %s parent 1:11 handle 10: netem delay %s loss %s',
];
const deleteScripts = [
'sudo tc qdisc del dev %s root',
];
module.exports = {
sltc: config => {
const options = merge({}, defaultConfig, config);
const sudo = options.sudo ? 'sudo ' : '';
const setupScripts = [
sudo + 'tc qdisc add dev %s handle 1: root htb',
sudo + 'tc filter add dev %s protocol ip prio 1 u32 match ip dport 80 0xffff flowid 1:11',
];
const rateScripts = [
sudo + 'tc class add dev %s parent 1: classid 1:11 htb rate %s',
];
const delayLossScripts = [
sudo + 'tc qdisc add dev %s parent 1:11 handle 10: netem delay %s loss %s',
];
const deleteScripts = [
sudo + 'tc qdisc del dev %s root',
];
if (options.remove) {

@@ -39,0 +39,0 @@ deleteScripts.forEach((script) => {

{
"description": "Simple Linux Traffic Control",
"version": "0.4.0",
"version": "0.5.0",
"bin": "./bin/sltc.js",

@@ -5,0 +5,0 @@ "main": "./lib/sltc.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc