feat: enhance proxy functionality with verbose logging and support for additional Linux distributions
Build and Release / release (push) Successful in 1m44s

This commit is contained in:
2026-09-02 13:14:41 +07:00
parent 35a3b403ec
commit 64f0bd1e8f
8 changed files with 86 additions and 42 deletions
+8 -13
View File
@@ -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