From fcb45e41e16ace4d1f8759ae62eb1085d4007e0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9A=B4=E8=BA=81=E6=9A=B4=E8=BA=81=E6=9C=80=E6=9A=B4?= =?UTF-8?q?=E8=BA=81/Bigforce?= Date: Sat, 24 Feb 2024 15:45:08 +0000 Subject: [PATCH] Optimize startClient opt params --- cli/client.js | 2 +- tunnel.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/client.js b/cli/client.js index 4459950..5ecfd32 100755 --- a/cli/client.js +++ b/cli/client.js @@ -51,7 +51,7 @@ for (const item of header_items) { headers[key.trim()] = data.join(':').trim() } -startClient(tunnel, target, port, headers, (err) => { +startClient(tunnel, target, port, {headers}, (err) => { if (err) showError(err) else console.info(`tunneling ${target} via ${tunnel} & exposing it on port ${port}`) }) diff --git a/tunnel.js b/tunnel.js index 9bd1a8d..ac0621e 100644 --- a/tunnel.js +++ b/tunnel.js @@ -4,8 +4,8 @@ const ws = require('websocket-stream') const pipe = require('pump') const debug = require('debug')('tcp-over-websockets:client') -const tunnelTo = (tunnel, target, headers) => (local) => { - const remote = ws(tunnel + (tunnel.slice(-1) === '/' ? '' : '/') + target, {headers : headers}) +const tunnelTo = (tunnel, target, opt) => (local) => { + const remote = ws(tunnel + (tunnel.slice(-1) === '/' ? '' : '/') + target, opt) const onError = (err) => { if (err) debug(err)