Class: NIO::WebSocket::Adapter::Proxy
- Inherits:
-
Object
- Object
- NIO::WebSocket::Adapter::Proxy
- Defined in:
- lib/nio/websocket/adapter/proxy.rb
Instance Attribute Summary collapse
-
#client_adapter ⇒ Object
readonly
Returns the value of attribute client_adapter.
-
#srv_adapter ⇒ Object
readonly
Returns the value of attribute srv_adapter.
Instance Method Summary collapse
- #add_to_reactor ⇒ Object
-
#initialize(srv, client, options) ⇒ Proxy
constructor
A new instance of Proxy.
Constructor Details
#initialize(srv, client, options) ⇒ Proxy
Returns a new instance of Proxy.
7 8 9 10 11 12 13 14 15 |
# File 'lib/nio/websocket/adapter/proxy.rb', line 7 def initialize(srv, client, ) @srv_adapter = ProxyAdapter.new srv, do |data| client_adapter.write data end @client_adapter = ProxyAdapter.new client, do |data| srv_adapter.write data end WebSocket.logger.debug "Initiating proxy connection between #{srv} and #{client}" end |
Instance Attribute Details
#client_adapter ⇒ Object (readonly)
Returns the value of attribute client_adapter.
16 17 18 |
# File 'lib/nio/websocket/adapter/proxy.rb', line 16 def client_adapter @client_adapter end |
#srv_adapter ⇒ Object (readonly)
Returns the value of attribute srv_adapter.
16 17 18 |
# File 'lib/nio/websocket/adapter/proxy.rb', line 16 def srv_adapter @srv_adapter end |
Instance Method Details
#add_to_reactor ⇒ Object
18 19 20 21 |
# File 'lib/nio/websocket/adapter/proxy.rb', line 18 def add_to_reactor srv_adapter.add_to_reactor client_adapter.add_to_reactor end |