api

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package api implements the HTTP handshake against Telemost's cloud-api endpoint to obtain a goloom signalling session.

Index

Constants

View Source
const (
	BaseHost      = "https://cloud-api.yandex.ru"
	UserAgent     = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36"
	Origin        = "https://telemost.yandex.ru"
	Referer       = "https://telemost.yandex.ru/"
	ClientVersion = "191.0.0"
	SecChUA       = `"Google Chrome";v="147", "Not.A/Brand";v="8", "Chromium";v="147"`
)

Variables

This section is empty.

Functions

func DefaultHTTPClient

func DefaultHTTPClient() *http.Client

DefaultHTTPClient builds an http.Client tuned for short-lived handshake calls (no connection pooling needed, fail-fast timeout).

Types

type ClientConfiguration

type ClientConfiguration struct {
	MediaServerURL string      `json:"media_server_url"`
	ICEServers     []ICEServer `json:"ice_servers"`
}

ClientConfiguration is a subset of the conference's client_configuration block. Only the fields PoC #1 actually consumes are unmarshalled.

type ClientIDs

type ClientIDs struct {
	ClientInstanceID string
	IdempotencyKey   string
}

ClientIDs holds the per-process random identifiers reused across the HTTP handshake and (later) the WS subprotocol headers.

func NewClientIDs

func NewClientIDs() ClientIDs

NewClientIDs returns a fresh pair of UUID v4 values.

type ConnectionResponse

type ConnectionResponse struct {
	ConnectionType      string              `json:"connection_type"`
	URI                 string              `json:"uri"`
	RoomID              string              `json:"room_id"`
	SafeRoomID          string              `json:"safe_room_id"`
	PeerID              string              `json:"peer_id"`
	SessionID           string              `json:"session_id"`
	PeerSessionID       string              `json:"peer_session_id"`
	Credentials         string              `json:"credentials"`
	MediaPlatform       string              `json:"media_platform"`
	ExpirationTime      int64               `json:"expiration_time"`
	ConferenceLimit     int                 `json:"conference_limit"`
	ClientConfiguration ClientConfiguration `json:"client_configuration"`
}

ConnectionResponse holds the parsed payload of GET /connection. Telemost returns many additional fields (chat_path, conference_state, etc) — we ignore them.

func FetchConnection

func FetchConnection(ctx context.Context, hc *http.Client, meetingURL, displayName string, ids ClientIDs) (*ConnectionResponse, error)

FetchConnection performs the GET /connection handshake. meetingURL must be the full https://telemost.yandex.ru/j/<id> URL (we URL-encode it for the path segment). displayName is the guest's display label, e.g. "Гость" or "PoC1".

type ICEServer

type ICEServer struct {
	URLs       []string `json:"urls"`
	Username   string   `json:"username,omitempty"`
	Credential string   `json:"credential,omitempty"`
}

ICEServer mirrors the entries returned by Telemost in client_configuration.ice_servers AND in serverHello.rtcConfiguration.iceServers.

Jump to

Keyboard shortcuts

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