Command line client for Write.as https://write.as/apps/cli
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
313 B

  1. package api
  2. import (
  3. "fmt"
  4. "net/http"
  5. "code.as/core/socks"
  6. )
  7. var (
  8. TorPort = 9150
  9. )
  10. func torClient() *http.Client {
  11. dialSocksProxy := socks.DialSocksProxy(socks.SOCKS5, fmt.Sprintf("127.0.0.1:%d", TorPort))
  12. transport := &http.Transport{Dial: dialSocksProxy}
  13. return &http.Client{Transport: transport}
  14. }