New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for using Invidious through a HTTP Proxy #4270
base: master
Are you sure you want to change the base?
Conversation
Now that there's "proper" support for HTTP proxies, I suppose Invidious should also be removing its own proxy implementation at |
Won't that collide with the code in |
I think it might be helpful to add the http proxy for pulling in reddit comments as well, provided it s not alot more work on top of this. Reddit just recently IP banned alot of VPS IP ranges, so currently the easiest work around is to tunnel things either via TOR or cloudflare warp |
Reddit comments should already be fetched through the proxy in this PR |
Is this patch meant to also address the install step that says
? Edit: It might. At least this time the error is about npm, and I can probably figure out how to configure npm's proxy settings inside. |
The part that fetches the videojs dependencies is technically not a part of the main Invidious program so requests in that don't go through the configured proxy. |
Maybe we should? If one configure a proxy he expect all the requests to go through the proxy. |
This comment has been minimized.
This comment has been minimized.
Please use the edit button, don't triple post... Please don't go offtopic, create a separate issue for your npm discussion. |
I researched a bit more about how to best pass proxy settings to the build process and found that doing it securely (not revealing proxy hostname and credentials in the built image) is more complicated than I had hoped. So build-time proxy stuff should best be left for a 3rd-party project. @syeopite, I found a few more things that I'd prefer switched around in git history, and some whitespace that seems accidential. Please allow me to propose this alternative history for the same effect as your current PR. The last commit is just so you can easily verify that files in both branches are otherwise identical. If you like, feel free to hard-reset your branch to my proposal's 2nd commit. Does Crystal have an elegant way to use a common function to de-duplicate the |
Also fixes the build on nightly as the offending code was removed. Related to #4270 (comment)
Could you please rebase your changes? |
It seems like the upstream library no longer works on Crystal 1.12 |
@syeopite https://github.com/mamantoha/http_proxy/blob/master/CHANGELOG.md#0102 I think you might be able to update the library to a newer version for the crystal 1.12 support |
Oops! I didn't see the newest update 😅 |
@@ -18,6 +18,40 @@ end | |||
class HTTP::Client | |||
property family : Socket::Family = Socket::Family::UNSPEC | |||
|
|||
# Override stdlib to automatically initialize proxy if configured | |||
# | |||
# Accurate as of crystal 1.10.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it work with other crystal versions? (at least with the version matrix used in our CI pipeline)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep the initialize function wasn't touched
Partially addresses #301
To use just set at least the host and port configuration here in the Invidious configs.