You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
useLuKa\HeadlessTaskServerPhp\Server;
//Let's created connection to specific server $server = newServer(
'https://127.0.0.1:8080/', //Addres to your task-server'MySecretAuthKeyIfNeeded'//AUTH_KEY from server
);
//This test will return true, if server work correct$server->isAlive()
Create Task
//From var$task = newTask('here you can past your js');
//OR//From file$task = Task::fromFile('./path/to/file.js');
Set additional Options
$options = newOptions();
//Set locale for our browser$options->setLocale('en-US');
//Set proxy for our browser (http or socks5)$options->setUpstreamProxyUrl('https://username:password@proxy.com:80');
Run Task and get Response
$response = $server->runTask($task, $options);
//Get session$session = $response->getSession();
//Check if Task DONE in correct way$isDONE = $response->getStatus() === \LuKa\HeadlessTaskServerPhp\Enum\ResponseStatuses::RESOLVE;
//Get Timings (How much time take to process this Task)$timings = $response->getTimings()
//You can use this://$timings->getCreatedAt() //$timings->getBeginAt() //$timings->getEndAt()//Here will be provided all output from `resolve`$output = $response->getOutput();
About
Helper for sending requests to luka-dev/headless-task-server