feat: enhance proxy functionality with verbose logging and support for additional Linux distributions
Build and Release / release (push) Successful in 1m44s
Build and Release / release (push) Successful in 1m44s
This commit is contained in:
+8
-13
@@ -3,21 +3,16 @@
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func setProxy(enable bool, host string, port string) error {
|
||||
|
||||
httpProxy1 := fmt.Sprintf("HTTP_PROXY=http://%s:%s", host, port)
|
||||
httpProxy2 := fmt.Sprintf("http_proxy=http://%s:%s", host, port)
|
||||
|
||||
ENV_CONFIG = append(ENV_CONFIG, httpProxy1, httpProxy2)
|
||||
|
||||
httpsProxy1 := fmt.Sprintf("HTTPS_PROXY=http://%s:%s", host, port)
|
||||
httpsProxy2 := fmt.Sprintf("https_proxy=http://%s:%s", host, port)
|
||||
ENV_CONFIG = append(ENV_CONFIG, httpsProxy1, httpsProxy2)
|
||||
|
||||
if enable {
|
||||
ENV_CONFIG = make([]string, 0)
|
||||
ENV_CONFIG = []string{
|
||||
"HTTP_PROXY=http://" + host + ":" + port,
|
||||
"http_proxy=http://" + host + ":" + port,
|
||||
"HTTPS_PROXY=http://" + host + ":" + port,
|
||||
"https_proxy=http://" + host + ":" + port,
|
||||
}
|
||||
} else {
|
||||
ENV_CONFIG = nil
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user