Skip to main content
Glama

toggleHttp2

Enable or disable HTTP/2 protocol for Whistle proxy servers using the Whistle MCP Server. Manage HTTP/2 settings directly for optimized network performance.

Instructions

启用或禁用HTTP/2

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
enabledYes是否启用HTTP/2

Implementation Reference

  • Core handler function that toggles HTTP/2 by posting form data to Whistle's /cgi-bin/enable-http2 endpoint.
    async toggleHttp2(enabled: boolean): Promise<any> {
      const formData = new URLSearchParams();
      formData.append("clientId", `${Date.now()}-${Math.floor(Math.random() * 100)}`);
      formData.append("enableHttp2", enabled ? "1" : "0");
    
      const response = await axios.post(
        `${this.baseUrl}/cgi-bin/enable-http2`,
        formData,
        {
          headers: {
            "Content-Type": "application/x-www-form-urlencoded",
          },
        }
      );
      return response.data;
    }
  • src/index.ts:362-372 (registration)
    Registers the MCP tool 'toggleHttp2' with name, description, Zod input schema, and execute handler that calls WhistleClient.toggleHttp2 and formats response.
    server.addTool({
      name: "toggleHttp2",
      description: "启用或禁用HTTP/2",
      parameters: z.object({
        enabled: z.boolean().describe("是否启用HTTP/2"),
      }),
      execute: async (args) => {
        const result = await whistleClient.toggleHttp2(args.enabled);
        return formatResponse(result);
      },
    });
  • Zod schema defining the input parameter 'enabled' as boolean for the toggleHttp2 tool.
    parameters: z.object({
      enabled: z.boolean().describe("是否启用HTTP/2"),
    }),

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/7gugu/whistle-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server