Module: LiveKit::Utils

Defined in:
lib/livekit/utils.rb

Defined Under Namespace

Modules: StringifyKeysRefinement

Class Method Summary collapse

Class Method Details

.to_http_url(url) ⇒ Object

Utility function to convert WebSocket URLs to HTTP URLs



6
7
8
9
10
11
12
13
# File 'lib/livekit/utils.rb', line 6

def to_http_url(url)
  if url.start_with?("ws")
    # Replace 'ws' prefix with 'http'
    url.sub(/^ws/, "http")
  else
    url
  end
end