summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorBrandon Wiley <brandon@blanu.net>2016-11-16 15:10:16 -0600
committerBrandon Wiley <brandon@blanu.net>2016-11-16 15:10:16 -0600
commitfc4bf82171d7337c9db1ce91e553a3b9a97beb02 (patch)
treedbc39637fe5888e010b9cfd02536fd46add147e4 /common
parentc1d70905378fefa781172e9e9b314a816765c32a (diff)
Added new command line flags and refactored ClientSetup to use them
Diffstat (limited to 'common')
-rw-r--r--common/pt_extras/pt_extras.go10
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
}