Documentation
¶
Index ¶
Constants ¶
const ( New = 1 Connecting = 2 Connected = 3 Failed = 4 Closed = 5 Actpass = "actpass" // both fine. Passive = "passive" // server Active = "active" // client )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Certificate ¶
type Certificate struct {
// contains filtered or unexported fields
}
func NewCertificate ¶
func NewCertificate(key crypto.PrivateKey, tpl x509.Certificate) (*Certificate, error)
NewCertificate generates a new x509 compliant Certificate to be used by DTLS for encrypting data sent over the wire. This method differs from generateCertificate by allowing to specify a template x509.Certificate to be used in order to define certificate parameters.
func (*Certificate) Fingerprints ¶
func (c *Certificate) Fingerprints() []Fingerprint
type CertificateGenerator ¶
type CertificateGenerator interface {
GenerateCertificate() *Certificate
}
func NewCertManager ¶
func NewCertManager(unique bool) (CertificateGenerator, error)
NewCertManager if unique is true, we generate a cert for every call, otherwise we will use only one cert for all requests.
type Fingerprint ¶
type Option ¶
type Option struct {
Reader io.Reader
Writer io.Writer
Role string
OnState func(int)
Fingerprints *Fingerprint
Certificate *Certificate
}
type SrtpSession ¶
type SrtpSession struct {
// contains filtered or unexported fields
}
func NewSrtpSession ¶
func NewSrtpSession(transport *Transport) (*SrtpSession, error)
NewSrtpSession Start a new srtp session from dtls transport key.
func (*SrtpSession) DecryptSrtcp ¶
func (s *SrtpSession) DecryptSrtcp(dst, data []byte) ([]byte, error)
DecryptSrtcp is not concurrent-safe, but it won't be called in concurrent.
func (*SrtpSession) DecryptSrtp ¶
func (s *SrtpSession) DecryptSrtp(dst, data []byte) ([]byte, error)
DecryptSrtp is not concurrent-safe, but it won't be called in concurrent.
func (*SrtpSession) EncryptRtcp ¶
func (s *SrtpSession) EncryptRtcp(dst, packet []byte) ([]byte, int, error)
EncryptRtcp is not concurrent-safe, but it won't be called in concurrent.
func (*SrtpSession) EncryptRtp ¶
func (s *SrtpSession) EncryptRtp(dst, packet []byte) ([]byte, int, error)
EncryptRtp is not concurrent-safe, but it won't be called in concurrent.
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
func NewDtlsTransport ¶
normally if chrome generate offer it will be actpass if they are both fine, we prefer client, we could send client hello asap, zero rtt. but the problem is, without ice completed, the dtls client could fail, not verify could it be wait. client could fail, but fast.
func (*Transport) GetLocalFingerprints ¶
func (t *Transport) GetLocalFingerprints() []Fingerprint