Module: DRb::WebSocket

Defined in:
lib/opal/drb/websocket.rb

Defined Under Namespace

Classes: ClientSide, Server, ServerSide, SocketPool, StrStream

Class Method Summary collapse

Class Method Details

.open(uri, config) ⇒ Object



161
162
163
164
165
166
167
# File 'lib/opal/drb/websocket.rb', line 161

def self.open(uri, config)
  unless uri =~ /^ws:\/\/(.*?):(\d+)(\/(.*))?$/
    raise(DRbBadScheme, uri) unless uri =~ /^ws:/
    raise(DRbBadURI, 'can\'t parse uri:' + uri)
  end
  ClientSide.new(uri, config)
end

.open_server(uri, config) ⇒ Object



169
170
171
172
173
174
175
176
# File 'lib/opal/drb/websocket.rb', line 169

def self.open_server(uri, config)
  unless uri =~ /^ws:\/\/(.*?):(\d+)(\/(.*))?$/
    raise(DRbBadScheme, uri) unless uri =~ /^ws:/
    raise(DRbBadURI, 'can\'t parse uri:' + uri)
  end

  Server.new(uri, config)
end

.uri_option(uri, config) ⇒ Object



157
158
159
# File 'lib/opal/drb/websocket.rb', line 157

def self.uri_option(uri, config)
  return uri, nil
end