Skip to content

Commit

Permalink
Tor dialer generic function
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasinsaurralde committed Jun 8, 2016
1 parent 46a89ae commit 67a3e67
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package transports

import (
"net/http"
"golang.org/x/net/proxy"
)

type Transport struct {
Expand All @@ -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
}

0 comments on commit 67a3e67

Please sign in to comment.