Skip to content

Instantly share code, notes, and snippets.

@amane-katagiri
Last active April 30, 2022 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amane-katagiri/4ab0a27508147a5c862997c2d1b19450 to your computer and use it in GitHub Desktop.
Save amane-katagiri/4ab0a27508147a5c862997c2d1b19450 to your computer and use it in GitHub Desktop.
ローカルプロキシが立ってる時だけプロキシ経由で通信する
// 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