Ejemplo n.º 1
0
 /**
  * Open a connection from the SSH server
  *
  * @param string $host
  * @param int    $port
  * @return resource
  */
 public function getRemoteStream($host, $port = 22)
 {
     $this->requireConnection();
     $this->log(LogLevel::INFO, "Opening remote connection to " . $host . ":" . $port);
     return @ssh2_tunnel($this->resource, $host, $port);
 }
Ejemplo n.º 2
0
 public function tunnel($host = "localhost", $port = 22)
 {
     if (!$this->connect()) {
         return false;
     }
     return @ssh2_tunnel($this->connect, $host, $port);
 }