Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateBandwidthLimit() (l model.BandwidthLimit, err error)
- func Register(name string, c Creator)
- func SyncPassages(s Server, passages []Passage) (err error)
- type Argument
- type ContentionCache
- type ContentionCountdown
- type Creator
- type LimitedDNSConn
- type Passage
- type PassageUse
- type Server
Constants ¶
View Source
const LostThreshold = 5 * time.Minute
Variables ¶
View Source
var DefaultLimitedDialer = net.Dialer{ Control: func(network, address string, c syscall.RawConn) error { host, _, err := net.SplitHostPort(address) if err != nil { return err } ip, err := netaddr.ParseIP(host) if err != nil { return err } if common.IsPrivate(ip.IPAddr().IP) { return fmt.Errorf("%w: %v", ErrDialPrivateAddress, ip.String()) } return nil }, }
View Source
var ErrDialPrivateAddress = fmt.Errorf("request to dial a private address")
View Source
var Mapper = make(map[string]Creator)
View Source
var ( // ProtectTime is the cooling time of a client IP changing for the same passage ProtectTime = map[PassageUse]time.Duration{ PassageUseUser: 0, PassageUseRelay: 90 * time.Second, PassageUseManager: 300 * time.Second, } )
Functions ¶
func GenerateBandwidthLimit ¶ added in v0.1.15
func GenerateBandwidthLimit() (l model.BandwidthLimit, err error)
func SyncPassages ¶
Types ¶
type ContentionCache ¶
type ContentionCache struct {
// contains filtered or unexported fields
}
func NewContentionCache ¶
func NewContentionCache() *ContentionCache
type ContentionCountdown ¶
type ContentionCountdown struct {
// contains filtered or unexported fields
}
type LimitedDNSConn ¶ added in v1.0.0
LimitedDNSConn adheres to RFC 7766 section 5, "Transport Protocol Selection".
type PassageUse ¶
type PassageUse string
const ( PassageUseUser PassageUse = "user" PassageUseRelay PassageUse = "relay" PassageUseManager PassageUse = "manager" )
Click to show internal directories.
Click to hide internal directories.