diff options
Diffstat (limited to 'common')
-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 } |