Solved SOCKS5 proxy for only a few domains
-
I'm trying to configure a SOCKS5 proxy to be used for only two domains (say all websites at example.nl and example.net). The Proxy settings button in Vivaldi Settings brings me to a global Windows configuration, which doesn't seem to work, but adding the command line argument
--proxy-server="socks5://<host>:<port>"
does enable me to use the proxy. However, I can't figure out how to make sure the proxy is only used for these two domains. There is the argument--proxy-bypass-list
which lets me specify for which domains the proxy should not be used, but I'm looking for the reverse of that. Is there some other argument that I could use, or some syntax which would work with the bypass list to accomplish this?I know that an extension like Proxy SwitchyOmega would be able to do this, but I've been afraid to use it after reading this article: https://arstechnica.com/security/2025/01/dozens-of-backdoored-chrome-extensions-discovered-on-2-6-million-devices/
-
@beyondexcess Ah, ok.
Then something like proxy.pac file could help.
Wait…Untested!
/* example */ function FindProxyForURL(url, host) { if (dnsDomainIs(host, ".example.com") return "SOCKS 192.168.0.1:8055;"; if (dnsDomainIs(host, ".example.org") return "SOCKS 192.168.0.1:8055;"; return "DIRECT"; }
I think command line option would be (example):
vivaldi --proxy-pac-url=file:///T:/proxy.pac
More:
-
@beyondexcess I remember that commandline options for SOCKS proxy do not work correctly, on Linux it was discussed at
https://forum.vivaldi.net/topic/92354/no-socks5-proxy-support-yet -
@DoctorG I haven't tried them on Linux, but they do work fine for me on Windows. Only problem is that the proxy is used for too many websites now.
-
@beyondexcess Ah, ok.
Then something like proxy.pac file could help.
Wait…Untested!
/* example */ function FindProxyForURL(url, host) { if (dnsDomainIs(host, ".example.com") return "SOCKS 192.168.0.1:8055;"; if (dnsDomainIs(host, ".example.org") return "SOCKS 192.168.0.1:8055;"; return "DIRECT"; }
I think command line option would be (example):
vivaldi --proxy-pac-url=file:///T:/proxy.pac
More:
-
@DoctorG Fantastic, that works! I adapted the file to:
function FindProxyForURL(url, host) { if (dnsDomainIs(host, ".example.com")) return "SOCKS5 192.168.0.1:8055"; if (dnsDomainIs(host, ".example.org")) return "SOCKS5 192.168.0.1:8055"; return "DIRECT"; }
That still didn't work, because apparently file:// urls are no longer allowed: https://superuser.com/questions/1405499/chrome-72-seems-to-no-longer-accept-proxy-pac-url
But I managed to work around that by starting Vivaldi from wsl and using jonny's answer on that page:
/path/to/vivaldi.exe --proxy-pac-url='data:application/x-javascript-config;base64,'$(base64 -w0 /path/to/proxy.pac)
thanks a lot!
-
@beyondexcess Oh, crazy solution.
Interesting that such Base64 encoded data-URL work.
And … oh, my goodness, starting by Linux shell.
Good trick.I guess that using a Powershell script would work, too, without Linux shell
But your solution is the shortest way to solve it. -
@beyondexcess Please Mark as Solution
- Edit the first post
- Open the dropdown on the Submit button and click the radio button saying Ask As Question
- Submit the post again
- Select the three dot vertical menu of the post that resolves the question
- Select the checkmark saying Mark This Post As The Correct Answer
-
Bbeyondexcess marked this topic as a question on
-
Bbeyondexcess has marked this topic as solved on