molnarg / node-http2

An HTTP/2 client and server implementation for node.js
MIT License
1.79k stars 187 forks source link

`createConnection` support #213

Open thammi opened 7 years ago

thammi commented 7 years ago

The Agent classes of http and https both have a createConnection() method which can be used to overwrite socket creation. http even supports createConnection as an option in request(). http2 does not support this part of the API and does not mention this difference in the API documentation.

It seems that implementing this for plain connections in http2 seems quite straight forward, but I have not fully understood the creation of connections for SSL in this library, yet.

PS: One use case for this is to tunnel the request through something like a VPN or SSH port forwarding by returning a socket-like object in createConnection

nwgh commented 7 years ago

I can see the use case for this, but I'd rather spend what limited time I have for this module on fixing actual bugs. I'm going to leave this open, and will gladly accept patches to add this functionality.