Documentation ¶
Index ¶
- Constants
- Variables
- func ContextualHttpTransport() *http.Transport
- func ProxyFromContext(r *http.Request) (*url.URL, error)
- type Proxy
- func (p Proxy) Address() string
- func (p Proxy) AsHttp() Proxy
- func (p Proxy) AsHttps() Proxy
- func (p Proxy) Bucket(buckets int) int
- func (p Proxy) IP() net.IP
- func (p Proxy) InContext(ctx context.Context) context.Context
- func (p Proxy) IsTunnel() bool
- func (p Proxy) MarshalJSON() ([]byte, error)
- func (p Proxy) MustNewGetRequest(url string) *http.Request
- func (p Proxy) Port() uint16
- func (p Proxy) Proto() proto
- func (p Proxy) Scheme() string
- func (p Proxy) String() string
- func (p Proxy) URL() *url.URL
- func (p Proxy) Valid() bool
Constants ¶
View Source
const ( // don't change the order!!! HTTP proto = iota HTTPS SOCKS4 SOCKS5 )
Variables ¶
View Source
var DefaultDialer = &net.Dialer{ Timeout: 5 * time.Second, KeepAlive: 0, }
View Source
var DefaultHttpClient = &http.Client{ Transport: ContextualHttpTransport(), Timeout: 10 * time.Second, }
View Source
var DefaultTlsConfig = &tls.Config{ InsecureSkipVerify: true, NextProtos: []string{"http/1.1"}, }
Functions ¶
func ContextualHttpTransport ¶
Types ¶
type Proxy ¶
type Proxy uint64
uint64 = uint32 + uint16 + uint16 (padding for alignment)
func GetProxyFromContext ¶
func HttpsProxy ¶
func NewProxyFromURL ¶ added in v0.3.0
func Socks4Proxy ¶
func Socks5Proxy ¶
func (Proxy) MarshalJSON ¶ added in v0.0.2
func (Proxy) MustNewGetRequest ¶ added in v0.0.7
MustNewGetRequest is a utility method for testing
Click to show internal directories.
Click to hide internal directories.