Source File
peeraddr.go
Belonging Package
github.com/pion/turn/v4/internal/proto
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage protoimport ()// PeerAddress implements XOR-PEER-ADDRESS attribute.//// The XOR-PEER-ADDRESS specifies the address and port of the peer as// seen from the TURN server. (For example, the peer's server-reflexive// transport address if the peer is behind a NAT.)//// RFC 5766 Section 14.3.type PeerAddress struct {IP net.IPPort int}func ( PeerAddress) () string {return stun.XORMappedAddress().String()}// AddTo adds XOR-PEER-ADDRESS to message.func ( PeerAddress) ( *stun.Message) error {return stun.XORMappedAddress().AddToAs(, stun.AttrXORPeerAddress)}// GetFrom decodes XOR-PEER-ADDRESS from message.func ( *PeerAddress) ( *stun.Message) error {return (*stun.XORMappedAddress)().GetFromAs(, stun.AttrXORPeerAddress)}// XORPeerAddress implements XOR-PEER-ADDRESS attribute.//// The XOR-PEER-ADDRESS specifies the address and port of the peer as// seen from the TURN server. (For example, the peer's server-reflexive// transport address if the peer is behind a NAT.)//// RFC 5766 Section 14.3.type XORPeerAddress = PeerAddress
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |