server

package
v0.0.0-...-a835f1f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2026 License: GPL-3.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(settings Settings) (*Server, error)

func (*Server) Accept

func (s *Server) Accept() (string, error)

func (*Server) Addr

func (s *Server) Addr() net.Addr

func (*Server) Close

func (s *Server) Close() error

func (*Server) GetConnection

func (s *Server) GetConnection(id string) (net.Conn, error)

func (*Server) RemoveConnection

func (s *Server) RemoveConnection(id string) error

func (*Server) Send

func (s *Server) Send(id string, payload []byte) error

func (*Server) SetConnection

func (s *Server) SetConnection(conn net.Conn) (string, error)

func (*Server) SetOnConnect

func (s *Server) SetOnConnect(f func(id string))

func (*Server) SetOnData

func (s *Server) SetOnData(f func(id string, payload []byte))

func (*Server) SetOnDisconnect

func (s *Server) SetOnDisconnect(f func(id string))

func (*Server) SetOnError

func (s *Server) SetOnError(f func(id string, err error))

type Settings

type Settings struct {
	Addr                 net.TCPAddr
	UseTLS               bool
	Cert                 tls.Certificate
	Timeout              uint32
	MaxFrameBytes        uint32
	MaxDecompressedBytes uint32
	ZipThreshold         uint32
}

type UDPServer

type UDPServer struct {
	// contains filtered or unexported fields
}

func NewUDPServer

func NewUDPServer(settings UDPSettings) (*UDPServer, error)

func (*UDPServer) Accept

func (s *UDPServer) Accept() (string, error)

func (*UDPServer) Addr

func (s *UDPServer) Addr() net.Addr

func (*UDPServer) Close

func (s *UDPServer) Close() error

func (*UDPServer) GetConnection

func (s *UDPServer) GetConnection(id string) (net.Conn, error)

func (*UDPServer) Send

func (s *UDPServer) Send(id string, payload []byte) error

func (*UDPServer) SetOnConnect

func (s *UDPServer) SetOnConnect(f func(id string))

func (*UDPServer) SetOnData

func (s *UDPServer) SetOnData(f func(id string, payload []byte))

func (*UDPServer) SetOnDisconnect

func (s *UDPServer) SetOnDisconnect(f func(id string))

func (*UDPServer) SetOnError

func (s *UDPServer) SetOnError(f func(id string, err error))

type UDPSettings

type UDPSettings struct {
	Addr                 net.UDPAddr
	Timeout              uint32
	MaxDatagramBytes     uint32
	MaxDecompressedBytes uint32
	ZipThreshold         uint32
}

type WebRTCPeer

type WebRTCPeer struct {
	// contains filtered or unexported fields
}

type WebRTCServer

type WebRTCServer struct {
	// contains filtered or unexported fields
}

func NewWebRTCServer

func NewWebRTCServer(settings WebRTCSettings) (*WebRTCServer, error)

func (*WebRTCServer) Accept

func (s *WebRTCServer) Accept() (string, error)

func (*WebRTCServer) AddICECandidate

func (s *WebRTCServer) AddICECandidate(candidate webrtc.ICECandidateInit) error

func (*WebRTCServer) AddICECandidateForPeer

func (s *WebRTCServer) AddICECandidateForPeer(id string, candidate webrtc.ICECandidateInit) error

func (*WebRTCServer) Addr

func (s *WebRTCServer) Addr() net.Addr

func (*WebRTCServer) ApplyRemoteDescription

func (s *WebRTCServer) ApplyRemoteDescription(desc webrtc.SessionDescription) error

func (*WebRTCServer) ApplyRemoteDescriptionForPeer

func (s *WebRTCServer) ApplyRemoteDescriptionForPeer(id string, desc webrtc.SessionDescription) error

func (*WebRTCServer) Close

func (s *WebRTCServer) Close() error

func (*WebRTCServer) CreatePeer

func (s *WebRTCServer) CreatePeer(id string) (*WebRTCPeer, error)

func (*WebRTCServer) GetConnection

func (s *WebRTCServer) GetConnection(id string) (net.Conn, error)

func (*WebRTCServer) RemovePeer

func (s *WebRTCServer) RemovePeer(id string) error

func (*WebRTCServer) Send

func (s *WebRTCServer) Send(id string, payload []byte) error

func (*WebRTCServer) SetOnConnect

func (s *WebRTCServer) SetOnConnect(f func(id string))

func (*WebRTCServer) SetOnData

func (s *WebRTCServer) SetOnData(f func(id string, payload []byte))

func (*WebRTCServer) SetOnDisconnect

func (s *WebRTCServer) SetOnDisconnect(f func(id string))

func (*WebRTCServer) SetOnError

func (s *WebRTCServer) SetOnError(f func(id string, err error))

func (*WebRTCServer) SetOnLocalCandidate

func (s *WebRTCServer) SetOnLocalCandidate(f func(candidate webrtc.ICECandidateInit))

func (*WebRTCServer) SetOnLocalCandidateForPeer

func (s *WebRTCServer) SetOnLocalCandidateForPeer(f func(id string, candidate webrtc.ICECandidateInit))

func (*WebRTCServer) SetOnLocalDescription

func (s *WebRTCServer) SetOnLocalDescription(f func(desc webrtc.SessionDescription))

func (*WebRTCServer) SetOnLocalDescriptionForPeer

func (s *WebRTCServer) SetOnLocalDescriptionForPeer(f func(id string, desc webrtc.SessionDescription))

type WebRTCSettings

type WebRTCSettings struct {
	Configuration        webrtc.Configuration
	MaxFrameBytes        uint32
	MaxDecompressedBytes uint32
	ZipThreshold         uint32
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL