Skip to content

Commit

Permalink
fix: properly connect to remote in proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenmatthewt authored and edvald committed Jun 2, 2020
1 parent 1ee05be commit 2a8b748
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions garden-service/src/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ async function createProxy(garden: Garden, log: LogEntry, service: Service, spec
return _remote
}

local.on("connect", () => {
log.debug(`Connection from ${local.remoteAddress}:${local.remotePort}`)
// tslint:disable-next-line: no-floating-promises
getRemote()
})
// net.Server.listen doesn't call the handler until a connection is established, in which
// case we can actually go ahead and contact the remote. Indeed, we need to in case the remote
// responds on connection.
// tslint:disable-next-line: no-floating-promises
getRemote()

const writeToRemote = (remote: Socket, data: Buffer) => {
if (!remote.writable) {
Expand Down

0 comments on commit 2a8b748

Please sign in to comment.