I’m trying to figure out how to enable HTTP keep alive using the OAuth2 gem. Oauth2 is built on Faraday, which does appear to have experimental support using net-http-persistent. The only way I can find to enable it in Faraday is to use:
Faraday.default_adapter = :net_http_persistent
I have a few questions:
- Is enabling it in Faraday in turn enabling it for Oauth2?
- Is there anyway to test whether HTTP keep alive is actually working and enabled?
I’m not familiar with ruby, but I believe you can test general http keep-alive settings by running TCPview on a windows machine and monitoring the connection state. (very useful program)
There is also this post on serverfault that discusses monitoring it from the server end: https://serverfault.com/questions/305388/how-to-test-keep-alive-is-working-on-client-end
If you are really paranoid about testing it, you should be able to see the keep alive bits in the http headers by viewing the connection stream with wireshark, but that might be a bit overkill.
Ps. I Saw that your team won the HACK-VT thing and decided to look you up due to your awesome Ruby presentations. Glad I could actually answer something!