send( str(new Response( 200, ['Content-Type' => 'text/html'], $this->getView() )) ); $connection->close(); } protected function getView(): string { $view = file_get_contents(base_path('resources/views/index.html')); $view = str_replace('%subdomains%', implode(' ', Client::$subdomains), $view); return $view; } }