mirror of https://github.com/grpc/grpc-node.git
Merge pull request #2746 from mjameswh/http-connect-proxy-early-server-packet
HTTP CONNECT: handle early server packets
This commit is contained in:
commit
d90ca240fc
|
@ -233,6 +233,12 @@ export function getProxiedConnection(
|
||||||
' through proxy ' +
|
' through proxy ' +
|
||||||
proxyAddressString
|
proxyAddressString
|
||||||
);
|
);
|
||||||
|
// The HTTP client may have already read a few bytes of the proxied
|
||||||
|
// connection. If that's the case, put them back into the socket.
|
||||||
|
// See https://github.com/grpc/grpc-node/issues/2744.
|
||||||
|
if (head.length > 0) {
|
||||||
|
socket.unshift(head);
|
||||||
|
}
|
||||||
if ('secureContext' in connectionOptions) {
|
if ('secureContext' in connectionOptions) {
|
||||||
/* The proxy is connecting to a TLS server, so upgrade this socket
|
/* The proxy is connecting to a TLS server, so upgrade this socket
|
||||||
* connection to a TLS connection.
|
* connection to a TLS connection.
|
||||||
|
|
Loading…
Reference in New Issue