Documentation ¶
Overview ¶
Package turn contains the STUN/TURN server.
Index ¶
- type CampfireAnswer
- type CampfireCandidate
- type CampfireClient
- func (c *CampfireClient) Announce(ufrag, pwd string) error
- func (c *CampfireClient) Answers() <-chan CampfireAnswer
- func (c *CampfireClient) Candidates() <-chan CampfireCandidate
- func (c *CampfireClient) Close() error
- func (c *CampfireClient) Errors() <-chan error
- func (c *CampfireClient) Offers() <-chan CampfireOffer
- func (c *CampfireClient) SendAnswer(ufrag, pwd string, answer webrtc.SessionDescription) error
- func (c *CampfireClient) SendCandidate(ufrag, pwd string, candidate *webrtc.ICECandidate) error
- func (c *CampfireClient) SendOffer(ufrag, pwd string, offer webrtc.SessionDescription) error
- type CampfireClientOptions
- type CampfireOffer
- type Options
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CampfireAnswer ¶ added in v0.1.5
CampfireAnswer represents an answer that was received from a peer.
type CampfireCandidate ¶ added in v0.1.5
CampfireCandidate represents a candidate that was received from a peer.
type CampfireClient ¶ added in v0.1.5
type CampfireClient struct {
// contains filtered or unexported fields
}
CampfireClient represents a client that can communicate with a TURN server supporting campfire.
func NewCampfireClient ¶ added in v0.1.5
func NewCampfireClient(opts CampfireClientOptions) (*CampfireClient, error)
NewCampfireClient creates a new CampfireClient.
func (*CampfireClient) Announce ¶ added in v0.1.5
func (c *CampfireClient) Announce(ufrag, pwd string) error
Announce announces interest in offers containing the given ufrag and pwd.
func (*CampfireClient) Answers ¶ added in v0.1.5
func (c *CampfireClient) Answers() <-chan CampfireAnswer
Answers returns a channel of answers received from peers.
func (*CampfireClient) Candidates ¶ added in v0.1.5
func (c *CampfireClient) Candidates() <-chan CampfireCandidate
Candidates returns a channel of candidates received from peers.
func (*CampfireClient) Close ¶ added in v0.1.5
func (c *CampfireClient) Close() error
Close closes the client.
func (*CampfireClient) Errors ¶ added in v0.1.5
func (c *CampfireClient) Errors() <-chan error
Errors returns a channel of errors.
func (*CampfireClient) Offers ¶ added in v0.1.5
func (c *CampfireClient) Offers() <-chan CampfireOffer
Offers returns a channel of offers received from peers.
func (*CampfireClient) SendAnswer ¶ added in v0.1.5
func (c *CampfireClient) SendAnswer(ufrag, pwd string, answer webrtc.SessionDescription) error
SendAnswer sends an answer to the peer with the given ufrag and pwd.
func (*CampfireClient) SendCandidate ¶ added in v0.1.5
func (c *CampfireClient) SendCandidate(ufrag, pwd string, candidate *webrtc.ICECandidate) error
SendCandidate sends a candidate to the peer with the given ufrag and pwd.
func (*CampfireClient) SendOffer ¶ added in v0.1.5
func (c *CampfireClient) SendOffer(ufrag, pwd string, offer webrtc.SessionDescription) error
SendOffer sends an offer to the peer with the given ufrag and pwd.
type CampfireClientOptions ¶ added in v0.1.5
type CampfireClientOptions struct { // Addr is the address of the STUN/TURN server. Addr string // Ufrag is the username fragment to use when communicating with the server. Ufrag string // Pwd is the password to use when communicating with the server. Pwd string // PSK is the pre-shared key used for encrypting/decrypting the data in sent/received // messages. PSK []byte }
CampfireClientOptions represents options for a CampfireClient.
type CampfireOffer ¶ added in v0.1.5
CampfireOffer represents an offer that was received from a peer.
type Options ¶
type Options struct { // PublicIP is the public IP address of the TURN server. PublicIP string // ListenAddressUDP is the address the TURN server uses for request // handling and STUN relays. // Defaults to 0.0.0.0. ListenAddressUDP string // ListenPortUDP is the port the TURN server listens on for UDP requests. ListenPortUDP int // Realm is the realm used for authentication. Realm string // PortRange is the range of ports the TURN server will use for relaying. PortRange string }
Options contains the options for the TURN server.