Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 20-Jul-2021 | - | ||||
go-ieproxy-0.0.1/ | H | 06-Apr-2020 | - | 1,006 | 801 | |
.gitignore | H A D | 20-Jul-2021 | 7 | 1 | 1 | |
LICENSE | H A D | 20-Jul-2021 | 1.1 KiB | 24 | 19 | |
README.md | H A D | 20-Jul-2021 | 2 KiB | 50 | 34 | |
go.mod | H A D | 20-Jul-2021 | 201 | 10 | 7 | |
go.sum | H A D | 20-Jul-2021 | 1 KiB | 12 | 11 | |
ieproxy.go | H A D | 20-Jul-2021 | 1.7 KiB | 52 | 25 | |
ieproxy_unix.go | H A D | 20-Jul-2021 | 155 | 11 | 6 | |
ieproxy_windows.go | H A D | 20-Jul-2021 | 5.7 KiB | 214 | 175 | |
kernel32_data_windows.go | H A D | 20-Jul-2021 | 337 | 20 | 15 | |
pac_unix.go | H A D | 20-Jul-2021 | 115 | 8 | 4 | |
pac_windows.go | H A D | 20-Jul-2021 | 2 KiB | 73 | 61 | |
proxy_middleman.go | H A D | 20-Jul-2021 | 218 | 12 | 8 | |
proxy_middleman_unix.go | H A D | 20-Jul-2021 | 237 | 14 | 8 | |
proxy_middleman_windows.go | H A D | 20-Jul-2021 | 1.3 KiB | 53 | 40 | |
utils.go | H A D | 20-Jul-2021 | 350 | 24 | 16 | |
winhttp_data_windows.go | H A D | 20-Jul-2021 | 1.7 KiB | 52 | 43 |
README.md
1# ieproxy 2 3Go package to detect the proxy settings on Windows platform. 4 5The settings are initially attempted to be read from the [`WinHttpGetIEProxyConfigForCurrentUser` DLL call](https://docs.microsoft.com/en-us/windows/desktop/api/winhttp/nf-winhttp-winhttpgetieproxyconfigforcurrentuser), but falls back to the registry (`CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings`) in the event the DLL call fails. 6 7For more information, take a look at the [documentation](https://godoc.org/github.com/mattn/go-ieproxy) 8 9## Methods 10 11You can either obtain a `net/http` compatible proxy function using `ieproxy.GetProxyFunc()`, set environment variables using `ieproxy.OverrideEnvWithStaticProxy()` (though no automatic configuration is available this way), or obtain the proxy settings via `ieproxy.GetConf()`. 12 13| Method | Supported configuration options: | 14|----------------------------------------|-----------------------------------------------| 15| `ieproxy.GetProxyFunc()` | Static, Specified script, and fully automatic | 16| `ieproxy.OverrideEnvWithStaticProxy()` | Static | 17| `ieproxy.GetConf()` | Depends on how you use it | 18 19## Examples 20 21### Using GetProxyFunc(): 22 23```go 24func init() { 25 http.DefaultTransport.(*http.Transport).Proxy = ieproxy.GetProxyFunc() 26} 27``` 28 29GetProxyFunc acts as a middleman between `net/http` and `mattn/go-ieproxy` in order to select the correct proxy configuration based off the details supplied in the config. 30 31### Using OverrideEnvWithStaticProxy(): 32 33```go 34func init() { 35 ieproxy.OverrideEnvWithStaticProxy() 36 http.DefaultTransport.(*http.Transport).Proxy = http.ProxyFromEnvironment 37} 38``` 39 40OverrideEnvWithStaticProxy overrides the relevant environment variables (`HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY`) with the **static, manually configured** proxy details typically found in the registry. 41 42### Using GetConf(): 43 44```go 45func main() { 46 conf := ieproxy.GetConf() 47 //Handle proxies how you want to. 48} 49``` 50