hisco / http2-client

Transparently make http request to both http1 / http2 server.
https://www.npmjs.com/package/http2-client
MIT License
33 stars 14 forks source link

TypeError: requestOptions.createConnection is not a function #2

Closed franz-liszt closed 6 years ago

franz-liszt commented 6 years ago

Hello,

Shortly after using the library with an https agent several times..

inStream.emit('socket' , requestOptions.createConnection());
                                              ^
TypeError: requestOptions.createConnection is not a function
    at HttpsRequest.makeHttp2Request (node_modules/http2-client/lib/request.js:415:47)
    at HttpsRequest.makeRequest (node_modules/http2-client/lib/request.js:344:21)
    at HttpsRequest.onIdentification (node_modules/http2-client/lib/request.js:279:24)
    at Object.onceWrapper (events.js:273:13)
    at HttpsRequest.emit (events.js:187:15)
    at HttpsRequest.onIdentify (node_modules/http2-client/lib/request.js:380:14)
    at TLSSocket.onConnect (node_modules/http2-client/lib/request.js:448:7)
    at Object.onceWrapper (events.js:273:13)
    at TLSSocket.emit (events.js:182:13)
    at TLSSocket.onConnectSecure (_tls_wrap.js:1074:10)

Please ask if you need more information

hisco commented 6 years ago

Thank you for reaching out! Fixed in #4 and available on npm latest.