diff options
author | Brandon Wiley <brandon@blanu.net> | 2016-11-16 15:10:16 -0600 |
---|---|---|
committer | Brandon Wiley <brandon@blanu.net> | 2016-11-16 15:10:16 -0600 |
commit | fc4bf82171d7337c9db1ce91e553a3b9a97beb02 (patch) | |
tree | dbc39637fe5888e010b9cfd02536fd46add147e4 /common/pt_extras | |
parent | c1d70905378fefa781172e9e9b314a816765c32a (diff) |
Added new command line flags and refactored ClientSetup to use them
Diffstat (limited to 'common/pt_extras')
-rw-r--r-- | common/pt_extras/pt_extras.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/common/pt_extras/pt_extras.go b/common/pt_extras/pt_extras.go index 5f287e3..17314bf 100644 --- a/common/pt_extras/pt_extras.go +++ b/common/pt_extras/pt_extras.go @@ -71,8 +71,14 @@ func PtIsClient() (bool, error) { return false, errors.New("not launched as a managed transport") } -func PtGetProxy() (*url.URL, error) { - specString := os.Getenv("TOR_PT_PROXY") +func PtGetProxy(proxy *string) (*url.URL, error) { + var specString string + + if proxy != nil { + specString = *proxy + } else { + specString = os.Getenv("TOR_PT_PROXY") + } if specString == "" { return nil, nil } |