Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateBandwidthLimit() (l model.BandwidthLimit, err error)
- func InitLimitedDialer()
- func Register(name string, c Creator)
- func RelayTCP(lConn, rConn netproxy.Conn) (err error)
- func RelayUDP(dst *net.UDPConn, laddr net.Addr, src net.PacketConn, timeout time.Duration) (err error)
- func RelayUDPToConn(dst netproxy.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 ForceNetworkType
- type LimitedDNSConn
- type Passage
- type PassageUse
- type PrivateLimitedDialer
- type PrivateLimitedUDPConn
- func (c *PrivateLimitedUDPConn) ReadFrom(p []byte) (n int, addr netip.AddrPort, err error)
- func (c *PrivateLimitedUDPConn) WriteMsgUDP(b, oob []byte, addr *net.UDPAddr) (n, oobn int, err error)
- func (c *PrivateLimitedUDPConn) WriteTo(b []byte, addr string) (int, error)
- func (c *PrivateLimitedUDPConn) WriteToUDP(b []byte, addr *net.UDPAddr) (int, error)
- 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 ErrDialPrivateAddress = fmt.Errorf("request to dial a private address")
View Source
var (
ErrPassageAbuse = fmt.Errorf("passage abuse")
)
View Source
var FullconePrivateLimitedDialer netproxy.Dialer
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 netproxy.Dialer
Functions ¶
func GenerateBandwidthLimit ¶ added in v0.1.15
func GenerateBandwidthLimit() (l model.BandwidthLimit, err error)
func InitLimitedDialer ¶ added in v1.3.0
func InitLimitedDialer()
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 ForceNetworkType ¶ added in v1.3.0
type ForceNetworkType int
const ( Force4 ForceNetworkType = iota Force6 KeepOrigin )
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
type PrivateLimitedDialer struct {
// contains filtered or unexported fields
}
func NewLimitedDialer ¶ added in v1.1.3
func NewLimitedDialer(fullCone bool, forceNetwork ForceNetworkType) *PrivateLimitedDialer
func (*PrivateLimitedDialer) Dial ¶ added in v1.1.3
func (d *PrivateLimitedDialer) Dial(network, addr string) (c netproxy.Conn, err error)
func (*PrivateLimitedDialer) DialTcp ¶ added in v1.3.2
func (d *PrivateLimitedDialer) DialTcp(addr string) (c netproxy.Conn, err error)
func (*PrivateLimitedDialer) DialUdp ¶ added in v1.3.2
func (d *PrivateLimitedDialer) DialUdp(addr string) (netproxy.PacketConn, error)
type PrivateLimitedUDPConn ¶ added in v1.1.3
func (*PrivateLimitedUDPConn) WriteMsgUDP ¶ added in v1.1.3
func (*PrivateLimitedUDPConn) WriteTo ¶ added in v1.1.3
func (c *PrivateLimitedUDPConn) WriteTo(b []byte, addr string) (int, error)
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.