From 46a89aeadd4a21925cfd7064485558e147862a2b Mon Sep 17 00:00:00 2001 From: Matias Insaurralde Date: Tue, 7 Jun 2016 21:46:49 -0400 Subject: [PATCH] Testing out Tor integration --- examples/wa-server.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/wa-server.go b/examples/wa-server.go index c4f9f47..be3ed1a 100644 --- a/examples/wa-server.go +++ b/examples/wa-server.go @@ -19,6 +19,7 @@ func main() { Login: os.Getenv("WA_SERVER_LOGIN"), Password: os.Getenv("WA_SERVER_PASSWORD"), Contact: os.Getenv("WA_SERVER_CONTACT"), + UseTor: true, YowsupWrapperPort: "8889", } @@ -32,7 +33,12 @@ func main() { } fmt.Println("--> Receiving, accepting message\n", request, "\n") - client := &http.Client{} + + transport := &http.Transport{} + if t.UseTor { + transport.Dial = transports.TorDialer().Dial + } + client := &http.Client{ Transport: transport} response, _ := client.Do(request) defer response.Body.Close()