Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateBandwidthLimit() (l model.BandwidthLimit, err error)
- func Register(name string, c Creator)
- func RelayTCP(lConn, rConn net.Conn) (err error)
- func RelayUDP(dst *net.UDPConn, laddr net.Addr, src net.PacketConn, timeout time.Duration) (err error)
- func RelayUDPToConn(dst net.Conn, src net.PacketConn, timeout time.Duration) (err error)
- func SelectTimeout(packet []byte) time.Duration
- func SyncPassages(s Server, passages []Passage) (err error)
- type Argument
- type ContentionCache
- type ContentionCountdown
- type Creator
- type LimitedDNSConn
- type Passage
- type PassageUse
- type PrivateLimitedDialer
- type PrivateLimitedUDPConn
- type Server
- type WriteCloser
Constants ¶
View Source
const ( DefaultNatTimeout = 3 * time.Minute DnsQueryTimeout = 17 * time.Second // RFC 5452 )
View Source
const LostThreshold = 5 * time.Minute
Variables ¶
View Source
var ( ErrFailAuth = fmt.Errorf("fail to authenticate") ErrPassageAbuse = fmt.Errorf("passage abuse") ErrReplayAttack = fmt.Errorf("replay attack") )
View Source
var ErrDialPrivateAddress = fmt.Errorf("request to dial a private address")
View Source
var FullconePrivateLimitedDialer = NewLimitedDialer(true)
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: 90 * time.Second, } )
View Source
var SymmetricPrivateLimitedDialer = NewLimitedDialer(false)
Functions ¶
func GenerateBandwidthLimit ¶ added in v0.1.15
func GenerateBandwidthLimit() (l model.BandwidthLimit, err error)
func RelayUDPToConn ¶ added in v1.1.0
func SelectTimeout ¶ added in v1.1.0
SelectTimeout selects an appropriate timeout for UDP packet.
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" )
type PrivateLimitedDialer ¶ added in v1.1.3
func NewLimitedDialer ¶ added in v1.1.3
func NewLimitedDialer(fullCone bool) *PrivateLimitedDialer
type PrivateLimitedUDPConn ¶ added in v1.1.3
func (*PrivateLimitedUDPConn) WriteMsgUDP ¶ added in v1.1.3
func (*PrivateLimitedUDPConn) WriteToUDP ¶ added in v1.1.3
type Server ¶
type WriteCloser ¶ added in v1.1.0
type WriteCloser interface {
CloseWrite() error
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.