Documentation
¶
Index ¶
- Constants
- func DataChannelConfig() *webrtc.DataChannelInit
- func DefaultICEServers() []webrtc.ICEServer
- func HostPeerFactory() tunnel.PeerFactory
- func PeerConfig() webrtc.Configuration
- type DataChannelTransport
- type Peer
- func (p *Peer) AddICECandidate(candidateStr string) error
- func (p *Peer) Close() error
- func (p *Peer) CreateAnswer() (string, error)
- func (p *Peer) CreateOffer() (string, error)
- func (p *Peer) IsReady() bool
- func (p *Peer) OnDCOpen(fn func())
- func (p *Peer) OnDisconnect(fn func())
- func (p *Peer) OnICECandidate(fn func(candidate string))
- func (p *Peer) OnMessage(fn func(data []byte))
- func (p *Peer) Send(data []byte) error
- func (p *Peer) SetRemoteAnswer(sdp string) error
- func (p *Peer) SetRemoteOffer(sdp string) error
Constants ¶
View Source
const DataChannelLabel = "ggcode-tunnel"
Variables ¶
This section is empty.
Functions ¶
func DataChannelConfig ¶
func DataChannelConfig() *webrtc.DataChannelInit
func DefaultICEServers ¶
func HostPeerFactory ¶
func HostPeerFactory() tunnel.PeerFactory
func PeerConfig ¶
func PeerConfig() webrtc.Configuration
Types ¶
type DataChannelTransport ¶
type DataChannelTransport struct {
// contains filtered or unexported fields
}
func NewDataChannelTransport ¶
func NewDataChannelTransport(peer *Peer) *DataChannelTransport
func (*DataChannelTransport) Close ¶
func (t *DataChannelTransport) Close() error
func (*DataChannelTransport) IsConnected ¶
func (t *DataChannelTransport) IsConnected() bool
func (*DataChannelTransport) OnDisconnect ¶
func (t *DataChannelTransport) OnDisconnect(handler func())
func (*DataChannelTransport) OnMessage ¶
func (t *DataChannelTransport) OnMessage(handler func(data []byte))
func (*DataChannelTransport) Send ¶
func (t *DataChannelTransport) Send(data []byte) error
type Peer ¶
type Peer struct {
// contains filtered or unexported fields
}
func (*Peer) AddICECandidate ¶
func (*Peer) CreateAnswer ¶
func (*Peer) CreateOffer ¶
func (*Peer) OnDisconnect ¶
func (p *Peer) OnDisconnect(fn func())
func (*Peer) OnICECandidate ¶
func (*Peer) SetRemoteAnswer ¶
func (*Peer) SetRemoteOffer ¶
Click to show internal directories.
Click to hide internal directories.