public static function register(ServerInterface $server)
    {
        self::$server = $server;

        $wrappers = stream_get_wrappers();

        foreach (['http', 'https'] as $protocol) {
            if (in_array($protocol, $wrappers, true)) {
                stream_wrapper_unregister($protocol);
            }

            stream_wrapper_register($protocol, self::class, STREAM_IS_URL);
        }
    }