Documentation ¶
Index ¶
- Constants
- Variables
- func FromJSON(in string, obj interface{})
- func GetCertificate(hkdfParams *HKDFParams) (webrtc.Certificate, error)
- func GetPwd(hkdfParams *HKDFParams) (string, error)
- func GetUfrag(hkdfParams *HKDFParams) (string, error)
- func NewCertificate(hkdfParams *HKDFParams) (webrtc.Certificate, error)
- func PredictDTLSFingerprint(hkdfParams *HKDFParams) (webrtc.DTLSFingerprint, error)
- func ToJSON(obj interface{}) string
- type DeflatedICECandidate
- type HKDFParams
- type ICECandidate
- func (c *ICECandidate) Deflate() DeflatedICECandidate
- func (c *ICECandidate) Foundation() uint32
- func (c *ICECandidate) LocalPreference() uint16
- func (c *ICECandidate) NetworkType() ICENetworkType
- func (c *ICECandidate) OffsetComponentPreference() uint32
- func (c *ICECandidate) Preference() uint32
- func (c *ICECandidate) Priority() uint32
- func (c *ICECandidate) SetCandidateType(candidateType ICECandidateType) *ICECandidate
- func (c *ICECandidate) SetComponent(component ICEComponent) *ICECandidate
- func (c *ICECandidate) SetFoundation(foundation uint32) *ICECandidate
- func (c *ICECandidate) SetIpAddr(ipAddr net.IP) *ICECandidate
- func (c *ICECandidate) SetPort(port uint16) *ICECandidate
- func (c *ICECandidate) SetPriority(priority uint32) *ICECandidate
- func (c *ICECandidate) SetProtocol(protocol ICENetworkProtocol) *ICECandidate
- func (c *ICECandidate) SetTcpType(tcpType ice.TCPType)
- type ICECandidateType
- type ICEComponent
- type ICENetworkProtocol
- type ICENetworkType
- type ICEParameters
- type SDP
- func (s *SDP) AddAttrs(newval SDPAttribute)
- func (s *SDP) AddIceCandidates(newval ICECandidate)
- func (s *SDP) AddMedia(newval SDPMedia)
- func (S *SDP) Deflate(candidateIP []net.IP) *SDPDeflated
- func (s *SDP) SetFingerprint(newval webrtc.DTLSFingerprint)
- func (s *SDP) SetIceParams(newval ICEParameters)
- func (s *SDP) SetMalleables(newval SDPMalleables)
- func (s *SDP) String() string
- type SDPAttribute
- type SDPConnectionData
- type SDPDeflated
- type SDPMalleables
- type SDPMedia
- type SDPOrigin
- type SDPTiming
Constants ¶
const ( MINSECRETLEN int = 8 MINSALTLEN int = 8 MININFOPREFIXLEN int = 8 )
const ( SDPOffer uint8 = 1 SDPAnswer uint8 = 2 SDPOfferStr string = "offer" SDPAnswerStr string = "answer" )
Variables ¶
Functions ¶
func GetCertificate ¶
func GetCertificate(hkdfParams *HKDFParams) (webrtc.Certificate, error)
GetCertificate() generates DTLS Certificate used for webrtc.
func GetPwd ¶ added in v0.2.0
func GetPwd(hkdfParams *HKDFParams) (string, error)
func GetUfrag ¶ added in v0.2.0
func GetUfrag(hkdfParams *HKDFParams) (string, error)
func NewCertificate ¶ added in v0.2.0
func NewCertificate(hkdfParams *HKDFParams) (webrtc.Certificate, error)
NewCertificate() might be ambiguous: we have notices 2 possible version of Certificates. Use GetCertificate() instead.
func PredictDTLSFingerprint ¶
func PredictDTLSFingerprint(hkdfParams *HKDFParams) (webrtc.DTLSFingerprint, error)
Types ¶
type DeflatedICECandidate ¶ added in v0.4.0
type DeflatedICECandidate struct { IPUpper64 uint64 IPLower64 uint64 Composed32 uint32 // [16..31]: ICECandidate.port * (1<<16), [4..5]: ICECandidate.tcpType * (1<<4), [2..3]: ICECandidate.candidateType * (1<<2), [1]: ICECandidate.protocol * (1<<1), [0]: ICECandidate.ICEComponent-1 }
func (*DeflatedICECandidate) IPAddr ¶ added in v0.4.0
func (c *DeflatedICECandidate) IPAddr() (net.IP, error)
func (*DeflatedICECandidate) Inflate ¶ added in v0.4.0
func (c *DeflatedICECandidate) Inflate() ICECandidate
type HKDFParams ¶ added in v0.2.0
type HKDFParams struct {
// contains filtered or unexported fields
}
func NewHKDFParams ¶ added in v0.2.0
func NewHKDFParams() *HKDFParams
func (*HKDFParams) IsValid ¶ added in v0.3.0
func (p *HKDFParams) IsValid() bool
A valid HKDFParams has all 3 []byte with proper length.
func (*HKDFParams) SetInfoPrefix ¶ added in v0.3.0
func (p *HKDFParams) SetInfoPrefix(infoPrefix string) *HKDFParams
func (*HKDFParams) SetSalt ¶ added in v0.3.0
func (p *HKDFParams) SetSalt(salt string) *HKDFParams
func (*HKDFParams) SetSecret ¶ added in v0.3.0
func (p *HKDFParams) SetSecret(secret string) *HKDFParams
type ICECandidate ¶
type ICECandidate struct {
// contains filtered or unexported fields
}
func (*ICECandidate) Deflate ¶ added in v0.4.0
func (c *ICECandidate) Deflate() DeflatedICECandidate
func (*ICECandidate) Foundation ¶
func (c *ICECandidate) Foundation() uint32
func (*ICECandidate) LocalPreference ¶
func (c *ICECandidate) LocalPreference() uint16
func (*ICECandidate) NetworkType ¶
func (c *ICECandidate) NetworkType() ICENetworkType
func (*ICECandidate) OffsetComponentPreference ¶
func (c *ICECandidate) OffsetComponentPreference() uint32
func (*ICECandidate) Preference ¶
func (c *ICECandidate) Preference() uint32
func (*ICECandidate) Priority ¶
func (c *ICECandidate) Priority() uint32
func (*ICECandidate) SetCandidateType ¶
func (c *ICECandidate) SetCandidateType(candidateType ICECandidateType) *ICECandidate
func (*ICECandidate) SetComponent ¶
func (c *ICECandidate) SetComponent(component ICEComponent) *ICECandidate
Necessary
func (*ICECandidate) SetFoundation ¶
func (c *ICECandidate) SetFoundation(foundation uint32) *ICECandidate
func (*ICECandidate) SetIpAddr ¶
func (c *ICECandidate) SetIpAddr(ipAddr net.IP) *ICECandidate
func (*ICECandidate) SetPort ¶
func (c *ICECandidate) SetPort(port uint16) *ICECandidate
func (*ICECandidate) SetPriority ¶
func (c *ICECandidate) SetPriority(priority uint32) *ICECandidate
func (*ICECandidate) SetProtocol ¶
func (c *ICECandidate) SetProtocol(protocol ICENetworkProtocol) *ICECandidate
func (*ICECandidate) SetTcpType ¶
func (c *ICECandidate) SetTcpType(tcpType ice.TCPType)
type ICECandidateType ¶
type ICECandidateType uint8
const ( Host ICECandidateType = iota // 0 Srflx // 1 Prflx // 2 Relay // 3 // 2-bits Unknown )
3-bits to exchange
func (ICECandidateType) String ¶
func (ic ICECandidateType) String() string
type ICEComponent ¶
type ICEComponent uint8
const ( ICEComponentUnknown ICEComponent = iota // 0 ICEComponentRTP // 1 ICEComponentRTCP // 2 )
1-bit to exchange
type ICENetworkProtocol ¶
type ICENetworkProtocol uint8
const ( UDP ICENetworkProtocol = iota // 0 TCP // 1 // 1-bit BADNETWORKPROTOCOL )
1-bits to exchange
func (ICENetworkProtocol) String ¶
func (inp ICENetworkProtocol) String() string
type ICENetworkType ¶
type ICENetworkType uint8
const ( UDP4 ICENetworkType = iota UDP6 TCP4 TCP6 BADNETWORKTYPE )
Derived locally
func (ICENetworkType) String ¶
func (intype ICENetworkType) String() string
type ICEParameters ¶
type ICEParameters struct { UsernameFragment string // 16-char Password string // 32-char ICELite bool // Always false for now }
func PredictIceParameters ¶
func PredictIceParameters(hkdfParams *HKDFParams) (ICEParameters, error)
func (ICEParameters) Equal ¶ added in v0.2.0
func (i ICEParameters) Equal(d ICEParameters) bool
func (*ICEParameters) InjectSettingEngine ¶ added in v0.3.7
func (i *ICEParameters) InjectSettingEngine(se *webrtc.SettingEngine) error
InjectSettingEngine() would inject the pseudorandom ice-ufrag and ice-pwd into se *SettingEngine
type SDP ¶ added in v0.3.0
type SDP struct { SDPType string // value of "type" key Malleables SDPMalleables // v, o, s, t, c lines in "sdp" key's value Medias []SDPMedia // m lines in "sdp" key's value Attributes []SDPAttribute // a lines in "sdp" key's value Fingerprint webrtc.DTLSFingerprint // Also an attribute, but calculated IceParams ICEParameters // Also 2 attribute, but calculated IceCandidates []ICECandidate // Also attributes, but calculated }
func (*SDP) AddAttrs ¶ added in v0.3.1
func (s *SDP) AddAttrs(newval SDPAttribute)
func (*SDP) AddIceCandidates ¶ added in v0.3.1
func (s *SDP) AddIceCandidates(newval ICECandidate)
func (*SDP) SetFingerprint ¶ added in v0.3.1
func (s *SDP) SetFingerprint(newval webrtc.DTLSFingerprint)
func (*SDP) SetIceParams ¶ added in v0.3.1
func (s *SDP) SetIceParams(newval ICEParameters)
func (*SDP) SetMalleables ¶ added in v0.3.1
func (s *SDP) SetMalleables(newval SDPMalleables)
type SDPAttribute ¶ added in v0.3.1
The lines that does not impact
func (*SDPAttribute) String ¶ added in v0.3.1
func (sa *SDPAttribute) String() string
type SDPConnectionData ¶ added in v0.3.1
The lines that does not impact
func NewSDPConnectionData ¶ added in v0.3.1
func NewSDPConnectionData() SDPConnectionData
func (*SDPConnectionData) String ¶ added in v0.3.1
func (cp *SDPConnectionData) String() string
type SDPDeflated ¶ added in v0.3.1
type SDPDeflated struct { SDPType uint8 Candidates []DeflatedICECandidate }
SDPDeflated represents the minimal info need to be exchanged for SDP
func SDPDeflatedFromString ¶ added in v0.3.2
func SDPDeflatedFromString(SDS string) (SDPDeflated, error)
func (SDPDeflated) Inflate ¶ added in v0.3.1
func (sd SDPDeflated) Inflate() (*SDP, error)
func (*SDPDeflated) String ¶ added in v0.3.2
func (SD *SDPDeflated) String() string
String() return SDPDeflated in string format (old version compatibility)
type SDPMalleables ¶ added in v0.3.1
type SDPMalleables struct { Version uint32 // v=0 Origin SDPOrigin // o=- 0 0 IN IP4 0.0.0.0 SessionName string // s=- ConnectionData SDPConnectionData // c=IN IP4 0.0.0.0 Timing SDPTiming // t=0 0 }
SDPMalleable includes v, o, s, c, t which "do not affect the WebRTC session". (WebRTC For The Curious, page 13)
func NewSDPMalleables ¶ added in v0.3.1
func NewSDPMalleables() SDPMalleables
func PredictSDPMalleables ¶ added in v0.3.7
func PredictSDPMalleables(_ *HKDFParams) SDPMalleables
Reserved
func (*SDPMalleables) String ¶ added in v0.3.1
func (sm *SDPMalleables) String() string
v=0 o=- 0 0 IN IP4 0.0.0.0 s=- c=IN IP4 0.0.0.0 t=0 0
type SDPOrigin ¶ added in v0.3.1
type SDPOrigin struct { SessionId uint64 SessionVer uint32 ConnectionData SDPConnectionData }
The lines that does not impact
func NewSDPOrigin ¶ added in v0.3.1
func NewSDPOrigin() SDPOrigin
Source Files ¶
- deflatedICECandidate.go
- dtlsCertificate.go
- dtlsFingerprint.go
- errors.go
- hkdfParams.go
- iceCandidate.go
- iceCandidateType.go
- iceComponent.go
- iceNetworkProtocol.go
- iceNetworkType.go
- iceParameters.go
- privateIPChecker.go
- sdp.go
- sdpAttribute.go
- sdpConnectionData.go
- sdpDeflated.go
- sdpMalleables.go
- sdpMedia.go
- sdpOrigin.go
- sdpTiming.go
- utils.go