signaling

package
v0.0.0-...-bd170c5 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server structs.Server

func Initialize

func Initialize(allowedorigins []string, turnonly bool) *Server

func (*Server) AuthorizedOrigins

func (s *Server) AuthorizedOrigins(r *fasthttp.Request) bool

AuthorizedOrigins implements the CheckOrigin method of the websocket.Upgrader. This checks if the incoming request's origin is allowed to connect to the server. The server will log if the origin is permitted or rejected.

func (*Server) Handler

func (srv *Server) Handler(conn *websocket.Conn)

Handler is an HTTP handler that handles WebSocket connections and relays messages.

Given an HTTP request, this function will upgrade the connection to a WebSocket connection and start a new client session. The function will then read all incoming messages, decode them, validate them, and handle them accordingly.

func (*Server) Upgrader

func (s *Server) Upgrader(c *fiber.Ctx) error

Upgrader checks if the client requested a websocket upgrade, and if so, sets a local variable to true. If the client did not request a websocket upgrade, this middleware will return ErrUpgradeRequired. If the client is not allowed to connect, this middleware will return ErrForbidden. If the client does not provide a UGI, this middleware will return ErrBadRequest.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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