Skip to content

bunji2/findproxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

findproxy

Go implementation of FindProxyForURL

Usage

C:\work> findproxy.exe
findproxy.exe proxy.pac url...

Proxy.pac

Proxy Auto Configuration file

Sample

// proxy.pac
function FindProxyForURL(url, host) {
    if (dnsDomainIs(host, ".foo.co.jp")) {
        return "PROXY proxy1:8000"
    }
    if (shExpMatch(host, "*.com")) {
        return "PROXY proxy2:8080";
    }
    if (isInNet(host, "192.168.1.0", "255.255.255.0")) {
        return "PROXY 192.168.3.2:8000";
    }
    return "DIRECT";

}
C:\work> findproxy.exe proxy.pac http://hogehoge/hoge http://hoge.com/hoge http://192.168.1.45/ http://www.foo.co.jp/
http://hogehoge/hoge => DIRECT
http://hoge.com/hoge => PROXY proxy2:8080
http://192.168.1.45/ => PROXY 192.168.3.2:8000
http://www.foo.co.jp/ => PROXY proxy1:8000

About

Go implementation of FindProxyForURL

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages