Function connectSocket

  • Connects to a media socket using the provided connection options.

    Parameters

    Returns Promise<Socket>

    A promise that resolves to the connected socket.

    const options = {
    apiUserName: 'user123',
    apiKey: 'yourApiKeyHere',
    link: 'https://socketlink.com',
    };

    try {
    const socket = await connectSocket(options);
    console.log('Connected to socket:', socket);
    } catch (error) {
    console.error('Failed to connect to socket:', error);
    }