Files
FireflyGo_Proxy/system_proxy_linux.go
AzenKain 9d769ed08c
Some checks failed
Build and Release / release (push) Failing after 26s
init
2025-12-12 17:37:34 +07:00

25 lines
575 B
Go

//go:build linux
// +build linux
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)
}
return nil
}