/** * 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); }
public function tunnel($host = "localhost", $port = 22) { if (!$this->connect()) { return false; } return @ssh2_tunnel($this->connect, $host, $port); }