Skip to content

Commit

Permalink
always change system proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
txthinking committed Aug 26, 2017
1 parent 8d9678f commit 86bf48f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 31 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ Brook's goal is to reduce the configuration steps. Keep it simple, stupid.

| Download | Server/Client | OS | Arch | Remark |
| --- | --- | --- | --- | --- |
| [brook](https://github.com/txthinking/brook/releases/download/v20170814/brook) | Server & Client | Linux | amd64 | CLI |
| [brook_linux_386](https://github.com/txthinking/brook/releases/download/v20170814/brook_linux_386) | Server & Client | Linux | 386 | CLI |
| [brook_linux_arm64](https://github.com/txthinking/brook/releases/download/v20170814/brook_linux_arm64) | Server & Client | Linux | arm64 | CLI |
| [brook_linux_arm5](https://github.com/txthinking/brook/releases/download/v20170814/brook_linux_arm5) | Server & Client | Linux | arm5 | CLI |
| [brook_linux_arm6](https://github.com/txthinking/brook/releases/download/v20170814/brook_linux_arm6) | Server & Client | Linux | arm6 | CLI |
| [brook_linux_arm7](https://github.com/txthinking/brook/releases/download/v20170814/brook_linux_arm7) | Server & Client | Linux | arm7 | CLI |
| [brook_macos_amd64](https://github.com/txthinking/brook/releases/download/v20170814/brook_macos_amd64) | Server & Client | MacOS | amd64 | CLI |
| [brook_windows_amd64.exe](https://github.com/txthinking/brook/releases/download/v20170814/brook_windows_amd64.exe) | Server & Client | Windows | amd64 | CLI |
| [brook_windows_386.exe](https://github.com/txthinking/brook/releases/download/v20170814/brook_windows_386.exe) | Server & Client | Windows | 386 | CLI |
| [Brook.app.zip](https://github.com/txthinking/brook/releases/download/v20170814/Brook.app.zip) | Client | MacOS | amd64 | GUI |
| [Brook.exe](https://github.com/txthinking/brook/releases/download/v20170814/Brook.exe) | Client | Windows | amd64 | GUI |
| [Brook.386.exe](https://github.com/txthinking/brook/releases/download/v20170814/Brook.386.exe) | Client | Windows | 386 | GUI |
| [brook](https://github.com/txthinking/brook/releases/download/v20170826/brook) | Server & Client | Linux | amd64 | CLI |
| [brook_linux_386](https://github.com/txthinking/brook/releases/download/v20170826/brook_linux_386) | Server & Client | Linux | 386 | CLI |
| [brook_linux_arm64](https://github.com/txthinking/brook/releases/download/v20170826/brook_linux_arm64) | Server & Client | Linux | arm64 | CLI |
| [brook_linux_arm5](https://github.com/txthinking/brook/releases/download/v20170826/brook_linux_arm5) | Server & Client | Linux | arm5 | CLI |
| [brook_linux_arm6](https://github.com/txthinking/brook/releases/download/v20170826/brook_linux_arm6) | Server & Client | Linux | arm6 | CLI |
| [brook_linux_arm7](https://github.com/txthinking/brook/releases/download/v20170826/brook_linux_arm7) | Server & Client | Linux | arm7 | CLI |
| [brook_macos_amd64](https://github.com/txthinking/brook/releases/download/v20170826/brook_macos_amd64) | Server & Client | MacOS | amd64 | CLI |
| [brook_windows_amd64.exe](https://github.com/txthinking/brook/releases/download/v20170826/brook_windows_amd64.exe) | Server & Client | Windows | amd64 | CLI |
| [brook_windows_386.exe](https://github.com/txthinking/brook/releases/download/v20170826/brook_windows_386.exe) | Server & Client | Windows | 386 | CLI |
| [Brook.app.zip](https://github.com/txthinking/brook/releases/download/v20170826/Brook.app.zip) | Client | MacOS | amd64 | GUI |
| [Brook.exe](https://github.com/txthinking/brook/releases/download/v20170826/Brook.exe) | Client | Windows | amd64 | GUI |
| [Brook.386.exe](https://github.com/txthinking/brook/releases/download/v20170826/Brook.386.exe) | Client | Windows | 386 | GUI |
| [App Store](https://itunes.apple.com/us/app/brook-brook-shadowsocks-vpn-proxy/id1216002642) | Client | iOS | - | GUI |
| [Google Play](https://play.google.com/store/apps/details?id=com.txthinking.brook) / [Brook.apk](https://github.com/txthinking/brook/releases/download/v20170814/Brook.apk) | Client | Android | - | GUI |
| [Google Play](https://play.google.com/store/apps/details?id=com.txthinking.brook) / [Brook.apk](https://github.com/txthinking/brook/releases/download/v20170826/Brook.apk) | Client | Android | - | GUI |

MacOS GUI Client

Expand Down Expand Up @@ -80,7 +80,7 @@ USAGE:
brook [global options] command [command options] [arguments...]
VERSION:
20170814
20170826
AUTHOR:
Cloud <cloud@txthinking.com>
Expand Down
2 changes: 1 addition & 1 deletion cli/brook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var debugAddress string
func main() {
app := cli.NewApp()
app.Name = "Brook"
app.Version = "20170814"
app.Version = "20170826"
app.Usage = "A Cross-Platform Proxy Software"
app.Author = "Cloud"
app.Email = "cloud@txthinking.com"
Expand Down
9 changes: 3 additions & 6 deletions gui/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"os"
"runtime"

"github.com/getlantern/systray"
"github.com/skratchdot/open-golang/open"
Expand Down Expand Up @@ -40,7 +39,7 @@ func run() {
systray.AddMenuItem("---------", "").Disable()
mGithub := systray.AddMenuItem("Upgrade", "")
mEmail := systray.AddMenuItem("Contact: cloud@txthinking.com", "")
systray.AddMenuItem("Version: 20170814", "")
systray.AddMenuItem("Version: 20170826", "")
systray.AddMenuItem("---------", "").Disable()
mQuit := systray.AddMenuItem("Quit", "")

Expand Down Expand Up @@ -98,10 +97,8 @@ func run() {
}

stop := func() error {
if runtime.GOOS == "windows" {
if err := sysproxy.TurnOffSystemProxy(); err != nil {
return err
}
if err := sysproxy.TurnOffSystemProxy(); err != nil {
return err
}
if bk != nil {
bk.Shutdown()
Expand Down
11 changes: 1 addition & 10 deletions sysproxy/system_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"errors"
"os/exec"
"regexp"
"strings"
)

func getNetworkServices() ([]string, error) {
Expand Down Expand Up @@ -48,15 +47,7 @@ func TurnOnSystemProxy(pac string) error {
return err
}
for _, v := range nss {
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)
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

0 comments on commit 86bf48f

Please sign in to comment.