Skip to content

Instantly share code, notes, and snippets.

@amane-katagiri
Last active Apr 30, 2022
Embed
What would you like to do?
ローカルプロキシが立ってる時だけプロキシ経由で通信する
// https://developer.mozilla.org/ja/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_PAC_file
function FindProxyForURL(url, host)
{
if (isPlainHostName(host) || isInNet(host, "127.0.0.1", "255.255.255.255")) {
return "DIRECT";
} else {
return "SOCKS5 localhost:3128; DIRECT";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment