mirror of
https://github.com/mudler/luet.git
synced 2025-09-28 16:05:45 +00:00
* bump github.com/moby/buildkit to v0.13.0 Signed-off-by: Nianyu Shen <nianyu@spectrocloud.com> * fix: update dep usage based on newer version Signed-off-by: Nianyu Shen <nianyu@spectrocloud.com> * remove empty line Signed-off-by: Nianyu Shen <nianyu@spectrocloud.com> * ci: bump golang to 1.21.x * Bump moby * debug --------- Signed-off-by: Nianyu Shen <nianyu@spectrocloud.com> Co-authored-by: Nianyu Shen <nianyu@spectrocloud.com>
29 lines
909 B
Go
29 lines
909 B
Go
package sockets
|
|
|
|
import (
|
|
"net"
|
|
"os"
|
|
"strings"
|
|
)
|
|
|
|
// GetProxyEnv allows access to the uppercase and the lowercase forms of
|
|
// proxy-related variables. See the Go specification for details on these
|
|
// variables. https://golang.org/pkg/net/http/
|
|
func GetProxyEnv(key string) string {
|
|
proxyValue := os.Getenv(strings.ToUpper(key))
|
|
if proxyValue == "" {
|
|
return os.Getenv(strings.ToLower(key))
|
|
}
|
|
return proxyValue
|
|
}
|
|
|
|
// DialerFromEnvironment was previously used to configure a net.Dialer to route
|
|
// connections through a SOCKS proxy.
|
|
// DEPRECATED: SOCKS proxies are now supported by configuring only
|
|
// http.Transport.Proxy, and no longer require changing http.Transport.Dial.
|
|
// Therefore, only sockets.ConfigureTransport() needs to be called, and any
|
|
// sockets.DialerFromEnvironment() calls can be dropped.
|
|
func DialerFromEnvironment(direct *net.Dialer) (*net.Dialer, error) {
|
|
return direct, nil
|
|
}
|