-
Notifications
You must be signed in to change notification settings - Fork 211
Expand file tree
/
Copy pathconstant.go
More file actions
38 lines (32 loc) · 1.05 KB
/
constant.go
File metadata and controls
38 lines (32 loc) · 1.05 KB
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
34
35
36
37
38
package constant
import "time"
type RelayType string
var (
// Version is overridden at link time by Makefile / goreleaser ldflags.
// The literal here is a fallback for raw `go build` invocations on master,
// kept slightly newer than the most recent stable tag so the update
// command's nightly auto-detection and downgrade guard behave sanely.
Version = "1.1.7-next"
GitBranch string
GitRevision string
BuildTime string
StartTime = time.Now().Local()
)
const (
DefaultDialTimeOut = 3 * time.Second
DefaultReadTimeOut = 5 * time.Second
DefaultIdleTimeOut = 30 * time.Second
DefaultSniffTimeOut = 300 * time.Millisecond
// todo,support config in relay config
BUFFER_POOL_SIZE = 1024 // support 512 connections
BUFFER_SIZE = 40 * 1024 // 40KB ,the maximum packet size of shadowsocks is about 16 KiB so this is enough
UDPBufSize = 1500 // use default max mtu 1500
)
// relay type
const (
// direct relay
RelayTypeRaw RelayType = "raw"
// ws relay
RelayTypeWS RelayType = "ws"
RelayTypeWSS RelayType = "wss"
)