MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / loadDockerProxy

Function loadDockerProxy

core/app/service/setting.go:718–732  ·  view source on GitHub ↗
(req dto.ProxyUpdate)

Source from the content-addressed store, hash-verified

716}
717
718func loadDockerProxy(req dto.ProxyUpdate) string {
719 if req.ProxyType == "" || req.ProxyType == "close" || !req.ProxyDocker {
720 return ""
721 }
722 var account string
723 if req.ProxyUser != "" {
724 account = req.ProxyUser
725 if req.ProxyPasswd != "" {
726 account += ":" + req.ProxyPasswd
727 }
728 account += "@"
729 }
730
731 return fmt.Sprintf("%s://%s%s:%s", req.ProxyType, account, strings.ReplaceAll(req.ProxyUrl, req.ProxyType+"://", ""), req.ProxyPort)
732}
733
734func checkProxy(req dto.ProxyUpdate) error {
735 var transport http.Transport

Callers 1

UpdateProxyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected