Skip to content

Commit c2f35eb

Browse files
committed
feat: add dummynet ipv6 throttling commands
1 parent 7c44e5e commit c2f35eb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/pfctl.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ export async function start(up, down, rtt = 0, packetLoss = 0) {
1313
await sudo('dnctl', 'pipe', 2, 'config', 'delay', '0ms', 'noerror');
1414

1515
await shell(
16-
'echo "dummynet in from any to ! 127.0.0.1 pipe 1\ndummynet out from ! 127.0.0.1 to any pipe 2" | sudo pfctl -f -'
16+
'echo "dummynet in inet from any to ! 127.0.0.1 pipe 1\n' +
17+
'dummynet out inet from ! 127.0.0.1 to any pipe 2\n' +
18+
'dummynet in inet6 from any to ! ::1 pipe 1\n' +
19+
'dummynet out inet6 from ! ::1 to any pipe 2" | sudo pfctl -f -'
1720
);
1821

1922
if (down) {

0 commit comments

Comments
 (0)