Skip to content

Commit

Permalink
remove remote update
Browse files Browse the repository at this point in the history
  • Loading branch information
txthinking committed Aug 8, 2017
1 parent 543df4b commit 2cd194e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
11 changes: 10 additions & 1 deletion sysproxy/system_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"errors"
"os/exec"
"regexp"
"strings"
)

func getNetworkServices() ([]string, error) {
Expand Down Expand Up @@ -47,7 +48,15 @@ func TurnOnSystemProxy(pac string) error {
return err
}
for _, v := range nss {
c := exec.Command("networksetup", "-setautoproxyurl", v, pac)
c := exec.Command("networksetup", "-getautoproxyurl", v)
out, err := c.CombinedOutput()
if err != nil {
return errors.New("ns apu:" + string(out) + ":" + err.Error())
}
if strings.Contains(string(out), pac) && strings.Contains(string(out), "Yes") {
continue
}
c = exec.Command("networksetup", "-setautoproxyurl", v, pac)
if out, err := c.CombinedOutput(); err != nil {
return errors.New("ns apu:" + string(out) + ":" + err.Error())
}
Expand Down
1 change: 0 additions & 1 deletion whitehttpmiddleman.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ type WhiteHTTPMiddleman struct {

// NewWhiteHTTPMiddleman returns a WhiteHTTPMiddleman which can used to handle http proxy request
func NewWhiteHTTPMiddleman(timeout, deadline int) *WhiteHTTPMiddleman {
blackwhite.InitWhiteList()
return &WhiteHTTPMiddleman{
Timeout: timeout,
Deadline: deadline,
Expand Down
1 change: 0 additions & 1 deletion whitesocks5middleman.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ type WhiteSocks5Middleman struct {

// NewWhiteSocks5Middleman returns a WhiteSocks5Middleman which can used to handle http proxy request
func NewWhiteSocks5Middleman(timeout, deadline int, dial Dialer) *WhiteSocks5Middleman {
blackwhite.InitWhiteList()
if dial == nil {
dial = &DefaultDial{}
}
Expand Down

0 comments on commit 2cd194e

Please sign in to comment.