-
Notifications
You must be signed in to change notification settings - Fork 3
/
options.go
33 lines (29 loc) · 924 Bytes
/
options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package rawhttp
import (
"net"
"time"
"github.com/zema1/rawhttp/client"
)
// Options contains configuration options for rawhttp client
type Options struct {
Timeout time.Duration
FollowRedirects bool
MaxRedirects int
AutomaticHostHeader bool
AutomaticContentLength bool
CustomHeaders client.Headers
ForceReadAllBody bool // ignores content length and reads all body
CustomRawBytes []byte
Proxy string
ProxyDialTimeout time.Duration
SNI string
TLSHandshake func(conn net.Conn, addr string, options *Options) (net.Conn, error)
}
// DefaultOptions is the default configuration options for the client
var DefaultOptions = &Options{
Timeout: 30 * time.Second,
FollowRedirects: true,
MaxRedirects: 10,
AutomaticHostHeader: true,
AutomaticContentLength: true,
}