| skipped 2 lines |
3 | 3 | | import ( |
4 | 4 | | "context" |
5 | 5 | | "crypto/tls" |
6 | | - | "github.com/DVKunion/SeaMoon/pkg/consts" |
7 | | - | "github.com/DVKunion/SeaMoon/pkg/utils" |
8 | | - | "github.com/google/martian/v3" |
9 | | - | log "github.com/sirupsen/logrus" |
10 | 6 | | "net" |
11 | 7 | | "net/http" |
12 | 8 | | "net/url" |
13 | 9 | | "strings" |
14 | 10 | | "time" |
| 11 | + | |
| 12 | + | "github.com/google/martian/v3" |
| 13 | + | log "github.com/sirupsen/logrus" |
| 14 | + | |
| 15 | + | "github.com/DVKunion/SeaMoon/pkg/consts" |
| 16 | + | "github.com/DVKunion/SeaMoon/pkg/utils" |
15 | 17 | | ) |
16 | 18 | | |
17 | 19 | | func HttpController(ctx context.Context, sg *SigGroup) { |
| skipped 9 lines |
27 | 29 | | } |
28 | 30 | | var proxyAddr string |
29 | 31 | | for _, p := range Config().ProxyAddr { |
30 | | - | if strings.HasPrefix(p, "http-proxy") { |
| 32 | + | if strings.HasPrefix(p, "http://") || strings.HasPrefix(p, "https://") { |
| 33 | + | proxyAddr = p |
| 34 | + | } else if strings.HasPrefix(p, "http-proxy") { |
31 | 35 | | proxyAddr = "http://" + p |
32 | 36 | | } |
33 | 37 | | } |
| skipped 64 lines |