Documentation
¶
Overview ¶
A simple WHIP client and server that implement a stream connection abstraction on top of a WebRTC data channel published via WHIP. Client adopted from https://github.com/ggarber/whip-go/
A simple WHIP client and server that implement a stream connection abstraction on top of a WebRTC data channel published via WHIP. Adopted from https://github.com/pion/webrtc/tree/master/examples/whip-whep
Index ¶
- Constants
- type Config
- type Dialer
- type DialerConn
- func (c *DialerConn) Close() error
- func (c *DialerConn) GetPeerConnection() *webrtc.PeerConnection
- func (c *DialerConn) LocalAddr() net.Addr
- func (c *DialerConn) Read(b []byte) (int, error)
- func (c *DialerConn) RemoteAddr() net.Addr
- func (c *DialerConn) SetDeadline(t time.Time) error
- func (c *DialerConn) SetReadDeadline(t time.Time) error
- func (c *DialerConn) SetWriteDeadline(t time.Time) error
- func (c *DialerConn) String() string
- func (c *DialerConn) Write(b []byte) (int, error)
- type Listener
- type ListenerConn
- func (c *ListenerConn) Close() error
- func (c *ListenerConn) LocalAddr() net.Addr
- func (c *ListenerConn) Read(b []byte) (int, error)
- func (c *ListenerConn) RemoteAddr() net.Addr
- func (c *ListenerConn) SetDeadline(t time.Time) error
- func (c *ListenerConn) SetReadDeadline(t time.Time) error
- func (c *ListenerConn) SetWriteDeadline(t time.Time) error
- func (c *ListenerConn) String() string
- func (c *ListenerConn) Write(b []byte) (int, error)
Constants ¶
const (
WhipEndpoint = "/whip"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ICEServers []webrtc.ICEServer
ICETransportPolicy webrtc.ICETransportPolicy
BearerToken, WHIPEndpoint string
}
type Dialer ¶
type Dialer struct {
// contains filtered or unexported fields
}
func (*Dialer) DialContext ¶
func (*Dialer) WithSettingEngine ¶
func (d *Dialer) WithSettingEngine(e webrtc.SettingEngine) *Dialer
type DialerConn ¶
type DialerConn struct {
// contains filtered or unexported fields
}
func (*DialerConn) Close ¶
func (c *DialerConn) Close() error
func (*DialerConn) GetPeerConnection ¶
func (c *DialerConn) GetPeerConnection() *webrtc.PeerConnection
GetPeerConnection returns the PeerConnection underlying the data channnel. Useful for checking ICE candidate status.
func (*DialerConn) RemoteAddr ¶
func (c *DialerConn) RemoteAddr() net.Addr
func (*DialerConn) SetDeadline ¶
func (c *DialerConn) SetDeadline(t time.Time) error
func (*DialerConn) SetReadDeadline ¶
func (c *DialerConn) SetReadDeadline(t time.Time) error
func (*DialerConn) SetWriteDeadline ¶
func (c *DialerConn) SetWriteDeadline(t time.Time) error
func (*DialerConn) String ¶
func (c *DialerConn) String() string
String returns a unique identifier for the connection based on the underlying signaling connection.
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
func NewListener ¶
func (*Listener) GetConns ¶
func (l *Listener) GetConns() []*ListenerConn
type ListenerConn ¶
type ListenerConn struct {
ResourceUrl string
PeerConn *webrtc.PeerConnection
DataConn datachannel.ReadWriteCloser
// contains filtered or unexported fields
}
func (*ListenerConn) Close ¶
func (c *ListenerConn) Close() error
func (*ListenerConn) RemoteAddr ¶
func (c *ListenerConn) RemoteAddr() net.Addr
func (*ListenerConn) SetDeadline ¶
func (c *ListenerConn) SetDeadline(t time.Time) error
func (*ListenerConn) SetReadDeadline ¶
func (c *ListenerConn) SetReadDeadline(t time.Time) error
func (*ListenerConn) SetWriteDeadline ¶
func (c *ListenerConn) SetWriteDeadline(t time.Time) error
func (*ListenerConn) String ¶
func (c *ListenerConn) String() string
String returns a unique identifier for the connection based on the underlying signaling connection.