toggleHttpsInterception
Enable or disable HTTPS interception to manage and monitor network requests through the Whistle proxy server. Control secure traffic analysis for improved debugging and rule management.
Instructions
启用或禁用HTTPS拦截
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| enabled | Yes | 是否启用HTTPS拦截 |
Implementation Reference
- src/index.ts:350-360 (registration)Registers the 'toggleHttpsInterception' MCP tool with name, description, input schema, and handler function that proxies to WhistleClient.server.addTool({ name: "toggleHttpsInterception", description: "启用或禁用HTTPS拦截", parameters: z.object({ enabled: z.boolean().describe("是否启用HTTPS拦截"), }), execute: async (args) => { const result = await whistleClient.toggleHttpsInterception(args.enabled); return formatResponse(result); }, });
- src/index.ts:356-359 (handler)MCP tool handler (execute function) that calls the underlying WhistleClient method and formats the response.execute: async (args) => { const result = await whistleClient.toggleHttpsInterception(args.enabled); return formatResponse(result); },
- src/index.ts:353-355 (schema)Zod schema defining the input parameter 'enabled' as boolean for toggling HTTPS interception.parameters: z.object({ enabled: z.boolean().describe("是否启用HTTPS拦截"), }),
- src/WhistleClient.ts:704-719 (helper)Core helper method in WhistleClient class that performs the actual HTTP POST to toggle HTTPS interception in Whistle server.async toggleHttpsInterception(enabled: boolean): Promise<any> { const formData = new URLSearchParams(); formData.append("clientId", `${Date.now()}-${Math.floor(Math.random() * 100)}`); formData.append("interceptHttpsConnects", enabled ? "1" : "0"); const response = await axios.post( `${this.baseUrl}/cgi-bin/intercept-https-connects`, formData, { headers: { "Content-Type": "application/x-www-form-urlencoded", }, } ); return response.data; }