Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthHandler ¶ added in v1.2.0
AuthHandler is a callback used to handle incoming auth requests, allowing users to customize Pion TURN with custom behavior
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a STUN server client
func NewClient ¶ added in v1.2.0
func NewClient(config *ClientConfig) (*Client, error)
NewClient returns a new Client instance. listeningAddress is the address and port to listen on, default "0.0.0.0:0"
type ClientConfig ¶ added in v1.2.0
type ClientConfig struct {
ListeningAddress string
LoggerFactory logging.LoggerFactory
Net *vnet.Net
}
ClientConfig is a bag of config parameters for Client.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is an instance of the Pion TURN server
func NewServer ¶ added in v1.2.0
func NewServer(config *ServerConfig) *Server
NewServer creates the Pion TURN server
func (*Server) AddListeningIPAddr ¶ added in v1.2.0
AddListeningIPAddr adds a listening IP address. If not specified, it will automatically assigns the listening IP addresses from the system. This method must be called before calling Start().
func (*Server) AddRelayIPAddr ¶ added in v1.2.1
AddRelayIPAddr adds a listening IP address. Note: current implementation can have only one relay IP address. If not specified, it will automatically assigns the relay IP addresses from the system. This method must be called before calling Start().
type ServerConfig ¶ added in v1.2.0
type ServerConfig struct {
// Realm sets the realm for this server
Realm string
// AuthHandler is the handler called on each incoming auth requests.
AuthHandler AuthHandler
// ChannelBindTimeout sets the lifetime of channel binding. Defaults to 10 minutes.
ChannelBindTimeout time.Duration
// ListeningPort sets the listening port number. Defaults to 3478.
ListeningPort int
// LoggerFactory must be set for logging from this server.
LoggerFactory logging.LoggerFactory
// Net is used by pion developers. Do not use in your application.
Net *vnet.Net
}
ServerConfig is a bag of config parameters for Server.
