| 716 | } |
| 717 | |
| 718 | func 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 | |
| 734 | func checkProxy(req dto.ProxyUpdate) error { |
| 735 | var transport http.Transport |