Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Repository files navigation

sysproxy

A Golang library for retrieving system proxy settings

Supported platforms and proxy types:

  • Windows (HTTP)
  • Darwin (HTTP/HTTPS)

Get HTTP/HTTPS proxies:

package main
import (
"fmt""github.com/oomol-lab/sysproxy"
)
funcmain() {
httpInfo, _:=sysproxy.GetHTTP()
ifhttpInfo!=nil {
fmt.Printf("http proxy host: %s, port: %d \n", httpInfo.Host, httpInfo.Port)
}
// Since Windows does not support setting an HTTPS proxy// GetHTTPS will always return nil with no error on the Windows platformhttpsInfo, _:=sysproxy.GetHTTPS()
ifhttpsInfo!=nil {
fmt.Printf("https proxy host: %s, port: %d \n", httpsInfo.Host, httpsInfo.Port)
}
// You can also using sysproxy.GetAll() get all proxy settings// httpInfo, httpsInfo, _ := sysproxy.GetAll()
}

About

sysproxy is a Golang library for retrieving system proxy settings

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages