accept binary key

This commit is contained in:
2025-09-28 09:45:31 -04:00
parent 2c47716c4e
commit 1c2d19d1ed
3 changed files with 10 additions and 10 deletions

View File

@@ -19,7 +19,7 @@ const { program } = require('commander');
program
.requiredOption('-H, --relay-host <host>', 'Relay server host to connect to')
.requiredOption('-P, --relay-port <port>', 'Relay server port for exit connections')
.requiredOption('--psk-file <path>', 'Path to PSK key file')
.requiredOption('--psk-file <path>', 'Path to binary PSK key file')
.requiredOption('--identity <identity>', 'PSK identity to use when connecting to relay')
.option('--connect-timeout <ms>', 'Timeout for outbound TCP connect (ms)', '10000')
.option('--reconnect-delay <ms>', 'Delay before reconnecting to relay (ms)', '2000')
@@ -29,7 +29,7 @@ const options = program.opts();
let pskKey;
try {
pskKey = fs.readFileSync(options.pskFile, 'utf8').trim();
pskKey = fs.readFileSync(options.pskFile);
} catch (error) {
console.error(`Error reading PSK file: ${error.message}`);
process.exit(1);
@@ -271,7 +271,7 @@ function connectToRelay() {
const pskCb = () => ({
identity: options.identity,
psk: Buffer.from(pskKey, 'hex'),
psk: pskKey,
});
const sock = tls.connect(