From fc4bf82171d7337c9db1ce91e553a3b9a97beb02 Mon Sep 17 00:00:00 2001 From: Brandon Wiley Date: Wed, 16 Nov 2016 15:10:16 -0600 Subject: Added new command line flags and refactored ClientSetup to use them --- common/pt_extras/pt_extras.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'common') 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 } -- cgit v1.2.3