tulir / gomuks

A Matrix client written in Go.
https://maunium.net/go/gomuks
GNU Affero General Public License v3.0
1.37k stars 123 forks source link

Document how to use with SOCKS5 proxy (tor) #335

Closed jjakob closed 1 year ago

jjakob commented 2 years ago

Torsocks doesn't work on Go programs since they don't use system libraries but use syscalls directly. Torsocks won't say any warnings about this, gomuks just silently won't be proxied over tor.

Go's net/http library by default uses environment variables to determine whether to use a proxy for http connections. I tried this and it works: HTTP_PROXY="socks5://127.0.0.1:9050" HTTPS_PROXY="$HTTP_PROXY" gomuks

https://gitlab.torproject.org/tpo/core/torsocks/-/issues/22068 https://pkg.go.dev/net/http#ProxyFromEnvironment