ViewTube / viewtube

▶️ ViewTube: The open source, privacy-conscious way to enjoy your favorite YouTube content. Docs: https://viewtube.wiki, Status: https://uptime.viewtube.io

Home Page:https://viewtube.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use warp proxy with viewtube ? And in generally how to use the proxy setting ?

iwannet opened this issue · comments

I've been trying to use the cloudflare Warp proxy on port 1080 with ViewTube, but I've been encountering difficulties. Here's what I've tried so far:

  • I set the VIEWTUBE_PROXY_URL environment variable to point to the Warp proxy. I tried 127.0.0.1:1080 and 172.17.0.1:1080. Both as an ip, http and https
  • I tested the proxy server's accessibility from within a Docker container using wget and the server seems not to be reachable.
    I tried wget -e use_proxy=yes -e https_proxy=127.0.0.1:1080 -O output.txt https://api.ipify.org/ and it returned that the proxy wasnt reachable (Connecting to 127.0.0.1:1080... failed: Connection refused.) When running the same command outside the container, it returns my ip.

The container gives the same error [ViewTube] Error 3/31/2024, 1:04:07 PM [ExceptionsHandler] connect ECONNREFUSED 172.17.0.1:1080 - {"stack":["Error: connect ECONNREFUSED 172.17.0.1:1080\n at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)"]}

  • I verified that the proxy server is running and listening on port 1080.

Despite these steps, I'm still unable to use the Warp proxy with ViewTube. The application doesn't seem to be routing requests through the proxy.

I'm not sure if this is a configuration issue on my end or a problem with ViewTube's proxy handling. Any help or guidance would be greatly appreciated.

And in generally, is the viewtube proxy a socks5, http or https proxy ?

And can i use
environment: - http_proxy=http://127.0.0.1:1080 - https_proxy=https://127.0.0.1:1080
instead of using the VIEWTUBE_PROXY_URL variable ?

Okay, i looked at the code and found that you use the ProxyAgent class from the undici library. This class supports HTTP and HTTPS proxies but no SOCKS proxies.

Now when i try wget --no-check-certificate -e use_proxy=yes -e http_proxy=172.17.0.1:1080 -O output.txt https://api.ipify.org/ it returns my normal ip, not the ip of the proxy

While wget --no-check-certificate -e use_proxy=yes -e https_proxy=172.17.0.1:1080 -O output.txt https://api.ipify.org/
returns Connecting to 172.17.0.1:1080... failed: Connection refused.

Okay i fixed it by using cmj2002/warp-docker#7

I added this to my services:

warp-viewtube: image: caomingjun/warp container_name: warp-viewtube restart: always ports: - '1080:1080' environment: - WARP_SLEEP=2 - WARP_LICENSE_KEY=key cap_add: - NET_ADMIN sysctls: - net.ipv6.conf.all.disable_ipv6=0 - net.ipv4.conf.all.src_valid_mark=1 volumes: - ./warp-data/cloudflare-warp:/var/lib/cloudflare-warp networks: - viewtube

and then i changed the proxy url to http://warp-viewtube:1080

Not really a fix, but good enough for me