Projects STRLCPY SeaMoon Commits 99c98fd1
🤬
  • ■ ■ ■ ■ ■
    .gitignore
    skipped 28 lines
    29 29  node_modules
    30 30  bootstrap
    31 31  .s/
     32 +.seamoom
  • ■ ■ ■ ■ ■
    pkg/client/config.go
    skipped 29 lines
    30 30   
    31 31  var (
    32 32   singleton *clientConfig
    33  - configPath = ".config"
     33 + configPath = ".seamoom"
    34 34  )
    35 35   
    36 36  func Config() *clientConfig {
    skipped 25 lines
    62 62   if err := toml.NewEncoder(&buf).Encode(c); err != nil {
    63 63   return err
    64 64   }
     65 + 
    65 66   fd, err := os.OpenFile(configPath, os.O_CREATE|os.O_WRONLY, 0644)
    66 67   if err != nil {
    67 68   return err
    skipped 30 lines
  • ■ ■ ■ ■ ■ ■
    pkg/client/http.go
    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
  • ■ ■ ■ ■ ■ ■
    pkg/client/socks.go
    skipped 38 lines
    39 39   }
    40 40   var proxyAddr string
    41 41   for _, p := range Config().ProxyAddr {
    42  - if strings.HasPrefix(p, "socks-proxy") {
    43  - if consts.Version == "dev" {
    44  - proxyAddr = "ws://127.0.0.1:8888"
    45  - } else {
    46  - proxyAddr = "ws://" + p
    47  - }
     42 + if strings.HasPrefix(p, "ws://") || strings.HasPrefix(p, "wss://") {
     43 + proxyAddr = p
     44 + } else if strings.HasPrefix(p, "socks-proxy") {
     45 + proxyAddr = "ws://" + p
    48 46   }
    49 47   }
    50 48   if proxyAddr == "" {
    skipped 121 lines
Please wait...
Page is in error, reload to recover