Closed zquestz closed 5 years ago
Hey thanks for submitting this. This is a neat idea but I don't think I'll merge this PR. The reason being, that Grab is already extendable in this way - without hard coding new functions and importing new dependencies.
The simplest way to do this is:
grab.DefaultClient.HTTPClient.Transport.Dial = proxy.Dial
There are an infinite number of other possible configurations that users may want. It wouldn't make sense to make convenience functions for this and every other useful configuration. Instead, we expose Client/Transport configuration.
Added
NewClientWithProxy
which allows using Socks5 proxies fromgithub.com/btcsuite/go-socks/socks
Also added
SetDefaultClientWithProxy
so that convenience functions can benefit from this.