diff options
author | delthas <delthas@dille.cc> | 2022-02-18 17:09:22 +0100 |
---|---|---|
committer | delthas <delthas@dille.cc> | 2022-02-18 17:09:22 +0100 |
commit | d0f189b2447bfbc87c5b15fc60cd389704eed732 (patch) | |
tree | 84b88797d413af12c8f36c190f0fe22fa6dd1324 /app.go | |
parent | Fix segfault on /mode x (diff) |
Add support for the ALL_PROXY, NO_PROXY environment variables
This adds support for SOCKS5 proxy support through standard environement
variables.
To connect to the SOCKS5 proxy at host:port with credentials user:pass,
run:
export ALL_PROXY=socks5://user:pass@host:port
Co-authored-by: the-y <the-y@riseup.net>
Diffstat (limited to 'app.go')
-rw-r--r-- | app.go | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -11,6 +11,8 @@ import ( "time" "unicode" + "golang.org/x/net/proxy" + "git.sr.ht/~taiite/senpai/irc" "git.sr.ht/~taiite/senpai/ui" "github.com/gdamore/tcell/v2" @@ -339,7 +341,7 @@ func (app *App) tryConnect() (conn net.Conn, err error) { } } - conn, err = net.Dial("tcp", addr) + conn, err = proxy.FromEnvironment().Dial("tcp", addr) if err != nil { return } |