Documentation
¶
Overview ¶
Package api implements the HTTP handshake against Telemost's cloud-api endpoint to obtain a goloom signalling session.
Index ¶
Constants ¶
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 ¶
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 ¶
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".