signaling

package module
v0.0.0-...-24c75d5 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 5 Imported by: 0

README

CL5 Signaling & Packet Relay Backend

Provides WebRTC Signaling & a server-side message relay. A core service for providing CL5 connectivity.

Requirements

  • Go 1.23.1 or newer

Usage

The signaling server is a standard Fiber v2 app, and can be natively mounted.

package main

import (
    "github.com/gofiber/fiber/v2"
    "github.com/cloudlink-omega/signaling"
)

func main() {

    // Initialize a new Fiber app
    app := fiber.New()

    // . . . 

    // Initialize the Signaling server
    signaling_server := signaling.New(
        []string{"*"}, // Provide a list of whitelisted origins to connect. Using * will permit all origins.
        false,         // TURN Only mode. Set to true to force the internal server relay to only use TURN servers.
    )

    // Mount the application
    app.Mount("/signaling", signaling_server.App)

    // . . .

    // Run the app
    app.Listen("localhost:3000")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SignalingServer

type SignalingServer struct {
	App    *fiber.App
	Server *srv.Server
}

func New

func New(

	Authorized_Origins []string,

	TURN_Only bool,

) *SignalingServer

New initializes a new SignalingServer with the given allowed origins and TURN only setting. The returned SignalingServer object contains the underlying structs.Server and a func that can be used to mount the WebSocket handler on a fiber.Router.

Jump to

Keyboard shortcuts

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