invidious
invidious copied to clipboard
[Enhancement] Don't override stdlib for `force_resolve` implementation
Is your enhancement request related to a problem? Please describe.
The current force_resolve implementation relies on patching the HTTP::Client in stdlib. It really isn't good practice.
Describe the solution you'd like
I've recently been made aware that it is possible to force the HTTP::Client to resolve a specific IP family without overriding the stdlib implementation.
See https://github.com/crystal-lang/crystal/issues/14196#issuecomment-1884003549
The downside is that we'll lose the automatic reconnect feature.
Describe alternatives you've considered
Create a new http client that inherits from stdlib with force_resolve implementation
Additional context
Thanks for opening an upstream issue for that!
Alternatively, we could just create a new client object that inherits from the stdlib HTTP::Client