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)