szmarczak / http2-wrapper

Use HTTP/2 the same way like HTTP/1
MIT License
239 stars 18 forks source link

Pass socket connection options in Agent #79

Open gagni opened 3 years ago

gagni commented 3 years ago

Hello,

I don't know if it's a bug, but I would like to pass a cipher, the version of the tls protocol,... in the agent but it doesn't work. I haven't found anything on the lib about this, so I don't know if this feature is functional or not. I checked with wireshark, but I still see the default list of nodejs configurations and not the configuration I gave as an option to the agent. When creating the agent I pass all the parameters in the options with the same property name as for the tls.createSecureContext: 'secureProtocol', 'maxVersion', minVersion', ciphers', dhparam'.

Is it in the options that you have to give it to the agent creation? Do you have an example that works?

Thank you in advance.

szmarczak commented 3 years ago

Is it in the options that you have to give it to the agent creation?

Agent accepts only SETTINGS from the connection options. Other connection options such as the TLS one are accepted via http2.request or http2.auto. From the docs:

Note: this is not compatible with the classic http.Agent.

gagni commented 3 years ago

So if we want to make an http2 request with a proxy is it possible ? and if it's possible, do you have an example how to do it?

szmarczak commented 3 years ago

Read. The. Docs. https://github.com/szmarczak/http2-wrapper#proxy-support