Skip to content

Commit

Permalink
Optimize startClient opt params
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyun94 committed Feb 24, 2024
1 parent 86baac3 commit fcb45e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cli/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
})
4 changes: 2 additions & 2 deletions tunnel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fcb45e4

Please sign in to comment.