Skip to content

Commit

Permalink
Fix createMultiServer in newer nodejs versions
Browse files Browse the repository at this point in the history
Make sure to set `socket.server` to the appropriate server handler before delegating.

This became required as of node v9.6, due to the changes introduced in nodejs/node@c247cb0

Fixes #10.
  • Loading branch information
shesek committed Sep 6, 2018
1 parent 7a5da03 commit aef8693
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- Bug fix: plain HTTP to TLS redirection under nodejs v9.6+ (#10)

## 0.1.1 - 2018-08-29

- Android: don't generate release builds
Expand Down
1 change: 1 addition & 0 deletions src/transport/tls.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const createMultiServer = (tlsOpt, tlsHandler, plainHandler) => {
socket.unshift(buff)

// Delegate the socket to the appropriate handler
socket.server = server[proto]
server[proto].emit('connection', socket)

socket.resume()
Expand Down

0 comments on commit aef8693

Please sign in to comment.