baseUrl = $baseUrl; } public function request($url): Response { $context = stream_context_create(options: [ 'ssl' => [ 'verify_peer' => false, ], ]); $connection = stream_socket_client( address: "tls://{$this->baseUrl}:1965", context: $context ); fwrite($connection, "gemini://{$this->baseUrl}{$url}"); $responseString = ''; while (!feof($connection)) { $responseString .= fgets($connection, 1024); } fclose($connection); $response = Response::fromString($responseString); return $response; } }