mirror of
https://github.com/laravel/valet.git
synced 2026-02-06 16:50:09 +01:00
Add set-ngrok-token command
This commit is contained in:
@@ -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.
|
||||
*
|
||||
@@ -65,4 +71,15 @@ public function findHttpTunnelUrl($tunnels, $domain)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Ngrok auth token.
|
||||
*
|
||||
* @param string $token
|
||||
* @return string
|
||||
*/
|
||||
public function setToken($token)
|
||||
{
|
||||
return $this->cli->runAsUser('./bin/ngrok authtoken '.$token);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user