| 2812 | }, options), { |
| 2813 | servername, |
| 2814 | session, |
| 2815 | localAddress, |
| 2816 | // TODO(HTTP/2): Add support for h2c |
| 2817 | ALPNProtocols: allowH2 ? ["http/1.1", "h2"] : ["http/1.1"], |
| 2818 | socket: httpSocket, |
| 2819 | // upgrade socket connection |
| 2820 | port, |
| 2821 | host: hostname |
| 2822 | })); |
| 2823 | socket.on("session", function(session2) { |
| 2824 | sessionCache.set(sessionKey, session2); |
| 2825 | }); |
| 2826 | } else { |
| 2827 | assert(!httpSocket, "httpSocket can only be sent on TLS update"); |
| 2828 | port = port || 80; |
| 2829 | socket = net.connect(__spreadProps(__spreadValues({ |