Module: DRbWebSocket::Protocol
- Defined in:
- lib/drb_web_socket/protocol.rb
Overview
A protocol with WebSocket for drb.
Class Method Summary collapse
Class Method Details
.open(uri, config) ⇒ Object
10 11 12 13 14 |
# File 'lib/drb_web_socket/protocol.rb', line 10 def open(uri, config) host, port = parse_uri(uri) socket = Wands::WebSocket.open(host, port) ConnectionToServer.new(uri, socket, config) end |
.open_server(uri, config) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/drb_web_socket/protocol.rb', line 16 def open_server(uri, config) host, port = parse_uri(uri) server = Wands::WebSocketServer.open(host, port) if port.zero? addr = server.addr port = addr[1] end uri = "drubyws://#{host}:#{port}" Server.new(uri, server, config) end |
.uri_option(uri, _config) ⇒ Object
29 30 31 |
# File 'lib/drb_web_socket/protocol.rb', line 29 def uri_option(uri, _config) [uri, nil] end |