Class: ReverseTunnel::Client
- Inherits:
-
Object
- Object
- ReverseTunnel::Client
- Defined in:
- lib/reverse-tunnel/client.rb
Defined Under Namespace
Classes: ApiServer, LocalConnection, LocalConnections, Tunnel, TunnelConnection
Instance Attribute Summary collapse
-
#api_host ⇒ Object
Returns the value of attribute api_host.
-
#api_port ⇒ Object
Returns the value of attribute api_port.
-
#local_port ⇒ Object
Returns the value of attribute local_port.
-
#server_host ⇒ Object
Returns the value of attribute server_host.
-
#server_port ⇒ Object
Returns the value of attribute server_port.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
Instance Attribute Details
#api_host ⇒ Object
Returns the value of attribute api_host.
289 290 291 |
# File 'lib/reverse-tunnel/client.rb', line 289 def api_host @api_host end |
#api_port ⇒ Object
Returns the value of attribute api_port.
289 290 291 |
# File 'lib/reverse-tunnel/client.rb', line 289 def api_port @api_port end |
#local_port ⇒ Object
Returns the value of attribute local_port.
287 288 289 |
# File 'lib/reverse-tunnel/client.rb', line 287 def local_port @local_port end |
#server_host ⇒ Object
Returns the value of attribute server_host.
288 289 290 |
# File 'lib/reverse-tunnel/client.rb', line 288 def server_host @server_host end |
#server_port ⇒ Object
Returns the value of attribute server_port.
288 289 290 |
# File 'lib/reverse-tunnel/client.rb', line 288 def server_port @server_port end |
#token ⇒ Object
Returns the value of attribute token.
287 288 289 |
# File 'lib/reverse-tunnel/client.rb', line 287 def token @token end |
Instance Method Details
#start ⇒ Object
269 270 271 272 273 274 |
# File 'lib/reverse-tunnel/client.rb', line 269 def start EventMachine.run do tunnel.start start_api end end |
#start_api ⇒ Object
276 277 278 279 280 281 |
# File 'lib/reverse-tunnel/client.rb', line 276 def start_api if api_host ReverseTunnel.logger.info "Wait api requests #{api_host}:#{api_port}" EventMachine.start_server api_host, api_port, ApiServer, tunnel end end |