1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-06 16:50:09 +01:00
This commit is contained in:
Matt Stauffer
2022-12-22 11:47:01 -05:00
4 changed files with 28 additions and 3 deletions

View File

@@ -8,11 +8,17 @@
class Ngrok
{
public $cli;
public $tunnelsEndpoints = [
'http://127.0.0.1:4040/api/tunnels',
'http://127.0.0.1:4041/api/tunnels',
];
public function __construct(CommandLine $cli)
{
$this->cli = $cli;
}
/**
* Get the current tunnel URL from the Ngrok API.
*
@@ -67,4 +73,15 @@ public function findHttpTunnelUrl(array $tunnels, string $domain): ?string
}
}
}
/**
* Set the Ngrok auth token.
*
* @param string $token
* @return string
*/
public function setToken($token)
{
return $this->cli->runAsUser('./bin/ngrok authtoken '.$token);
}
}