accept binary key
This commit is contained in:
@@ -33,7 +33,7 @@ const { program } = require('commander');
|
||||
program
|
||||
.requiredOption('-H, --server-host <host>', 'Proxy out-node server host')
|
||||
.requiredOption('-P, --server-port <port>', 'Proxy out-node server port')
|
||||
.requiredOption('--psk-file <path>', 'Path to PSK key file (hex)')
|
||||
.requiredOption('--psk-file <path>', 'Path to binary PSK key file')
|
||||
.requiredOption('--identity <identity>', 'PSK identity string')
|
||||
.requiredOption('--socks-port <port>', 'Local SOCKS5 proxy port to listen on')
|
||||
.option('--bind-host <host>', 'Local bind host', '127.0.0.1')
|
||||
@@ -46,7 +46,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);
|
||||
@@ -138,7 +138,7 @@ function createMessageReader() {
|
||||
function pskCallback(/* hint */) {
|
||||
return {
|
||||
identity: options.identity,
|
||||
psk: Buffer.from(pskKey, 'hex'),
|
||||
psk: pskKey,
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user