Method: Pssh::Client#initialize

Defined in:
lib/pssh/client.rb

#initializeClient

Returns a new instance of Client.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/pssh/client.rb', line 4

def initialize
  @pty = Pssh.pty = Pssh::Pty.new
  @socket = Pssh.socket = Pssh::Socket.new
  @web = Pssh.web = Pssh::Web.new
  @app = Rack::Builder.new do
    map "/assets/" do
      run Rack::File.new "#{Pssh.base_path}/assets/"
    end
    map "/socket" do
      run Pssh.socket
    end
    map "/" do
      run Pssh.web
    end
  end
  Thin::Logging.silent = true
  if Pssh.pty.existing?
    Thread.new do
      @console = Console.new
    end
  end
  Rack::Handler::Thin.run @app, Port: Pssh.port
end