diff --git a/transport.go b/transport.go index 864e892..2db94e5 100644 --- a/transport.go +++ b/transport.go @@ -2,6 +2,7 @@ package transports import ( "net/http" + "golang.org/x/net/proxy" ) type Transport struct { @@ -19,3 +20,11 @@ func (t *Transport) Handler(w http.ResponseWriter, req *http.Request) { func (t *Transport) Listen() { return } + +func TorDialer() (proxy.Dialer) { + dialer, err := proxy.SOCKS5("tcp", "127.0.0.1:9050", nil, proxy.Direct) + if err != nil { + panic(err) + } + return dialer +}