Skip to content

Commit

Permalink
Testing out Tor integration
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasinsaurralde committed Jun 8, 2016
1 parent 345a09a commit 46a89ae
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion examples/wa-server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}

Expand All @@ -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()

Expand Down

0 comments on commit 46a89ae

Please sign in to comment.