apify / proxy-chain

Node.js implementation of a proxy server (think Squid) with support for SSL, authentication and upstream proxy chaining.
https://www.npmjs.com/package/proxy-chain
Apache License 2.0
839 stars 139 forks source link

fix: accept pre-response data on CONNECT #284

Closed szmarczak closed 2 years ago

szmarczak commented 2 years ago

I think you'll have to do the same thing with clientHead on line 127 in chain.ts as well, for completeness.

That's from upstream proxies. I don't think in a real case scenario this would ever come from a server, because after the connection is established, the data is sent in another packet, therefore it should be not possible for this to occur. I remember there was a case where the upstream proxy sent a valid HTTP response (non-200 however) to a CONNECT.

I guess you're after backwards compatibility, so I have done that change.