Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bunji2/findproxy
Go implementation of FindProxyForURL
https://github.com/bunji2/findproxy
findproxyforurl golang javascript
Last synced: about 14 hours ago
JSON representation
Go implementation of FindProxyForURL
- Host: GitHub
- URL: https://github.com/bunji2/findproxy
- Owner: bunji2
- Created: 2021-01-31T14:43:58.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-01-31T14:44:48.000Z (almost 4 years ago)
- Last Synced: 2023-03-02T00:25:44.088Z (over 1 year ago)
- Topics: findproxyforurl, golang, javascript
- Language: Go
- Homepage:
- Size: 3.17 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# findproxy
Go implementation of FindProxyForURL
## Usage
```
C:\work> findproxy.exe
findproxy.exe proxy.pac url...
```## Proxy.pac
[Proxy Auto Configuration file](https://developer.mozilla.org/ja/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_(PAC)_file)
## Sample
```javascript
// 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
```