Class LibWebSocket::URL
In: lib/libwebsocket/url.rb
Parent: Object

Construct or parse a WebSocket URL.

Methods

new   parse   to_s  

Attributes

host  [RW] 
port  [RW] 
resource_name  [RW] 
secure  [RW] 

Public Class methods

Public Instance methods

Parse a WebSocket URL. @example Parse

  url = LibWebSocket::URL.new
  url.parse('wss://example.com:3000')
  url.host   # => example.com
  url.port   # => 3000
  url.secure # => true

Construct a WebSocket URL. @example Construct

  url = LibWebSocket::URL.new
  url.host = 'example.com'
  url.port = '3000'
  url.secure = true
  url.to_s # => 'wss://example.com:3000'

[Validate]