bigbluebutton-Github/bigbluebutton-tests/playwright/reconnection/util.js

18 lines
508 B
JavaScript
Raw Normal View History

2023-03-22 03:46:52 +08:00
const util = require('node:util');
const exec = util.promisify(require('node:child_process').exec);
const parameters = require('../core/parameters.js');
const hostname = new URL(parameters.server).hostname;
async function killConnection() {
await exec(`
sudo ss -K dst ${hostname} dport https;
sudo iptables -A OUTPUT -p tcp -d ${hostname} --dport 443 -j DROP;
sleep 1;
sudo iptables -D OUTPUT -p tcp -d ${hostname} --dport 443 -j DROP;
`);
2023-03-22 03:46:52 +08:00
}
exports.killConnection = killConnection;