Invidious: Allow to proxify request to YouTube

Created on 20 Jan 2019  路  5Comments  路  Source: iv-org/invidious

This could be useful for those having a self-hosted instance. The idea is about adding an option to specify a proxy server (e.g. tor socks proxy), which can be used when a server are going to make a request to YouTube to fetch the data.

enhancement

Most helpful comment

To be clear, the instance itself proxies requests, and then uses a proxy in another region as necessary to circumvent geo-restrictions (see #92). See my comment here for some clarification on what Invidious does.

There appears to be a socks shard that should make this possible, I'll have to look more into it to ensure it can be used here.

All 5 comments

Maybe it is also possible to proxy the youtube media through the server itself so that the users ip address is hidden to google. If this will be done, maybe also add the option to enable/disable this feature, because some hosters have traffic limit on their servers.

I honestly thought this is what invidious does. I was a bit surprised that it still connects me directly to youtube. This should definitely be possible, at least with self-hosting.

To be clear, the instance itself proxies requests, and then uses a proxy in another region as necessary to circumvent geo-restrictions (see #92). See my comment here for some clarification on what Invidious does.

There appears to be a socks shard that should make this possible, I'll have to look more into it to ensure it can be used here.

Running the invidious binary with torsocks should proxy requests through Tor.

I wish I could have replied to this earlier but our microsoft overlords decided they don't like my ISP.

torsocks overwrites calls to libc functions. Therefore it only works if your software is using libc. I believe the crystal network library is not implemented on top if libc, but I haven't tested nor do I know crystal. Source on that information (second and third paragraphs): https://gitweb.torproject.org/torsocks.git/tree/README.md

If this information is correct, the best way to tunnel the requests of your local instance through tor would be to either:

  1. Run it on a VM an route all the VM's traffic through tor;
  2. Run invidious under a dedicated user and use iptables to redirect every package from that user through a transparent proxy. In that case you have to make sure that your system is not using your ISP's DNS servers.
Was this page helpful?
0 / 5 - 0 ratings