Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Connection failure issue when the WebSocket URL for the LiveKit server has no path. #1439

@mjlee-VIRNECT

Description

@mjlee-VIRNECT

Describe the bug

If the WebSocket URL passed to the connect function does not contain a path, the connection fails, as shown in the image below.
This appears to be due to the inability to set an empty string for urlObj.pathname.
This issue has been occurring since updating to version 2.9.6.

Image

Reproduction

  1. Pass a WebSocket URL without a path when calling the connect function (e.g., 'wss://192.168.0.211:8073').
  2. An extra, unnecessary slash is added to the WebSocket URL, causing the connection to fail (e.g., 'wss://192.168.0.211:8073//rtc').

Logs

System Info

System:
    OS: Windows 10 Pro
    CPU: Intel(R) Core(TM) i9-10900F CPU @ 2.80GHz   2.81 GHz
    Memory: 16 GB / 32.00 GB
  Binaries:
    Node: 17.9.1
    Yarn: 1.22.22
    npm: 10.9.0
  Browsers:
    Chrome: 134.0.6998.35
  npmPackages:
    livekit-client: 2.9.4 => 2.9.6

Severity

blocking an upgrade

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions