ccproxy.core.plugins.hooks.implementations¶
ccproxy.core.plugins.hooks.implementations
¶
Built-in hook implementations for CCProxy.
This module contains standard hook implementations for common use cases: - MetricsHook: Prometheus metrics collection - LoggingHook: Structured logging - AnalyticsHook: Analytics data collection - AccessLoggingHook: Access logging (replaces AccessLogMiddleware) - ContentLoggingHook: Content logging for hooks-based logging - StreamingCaptureHook: Streaming response capture - HTTPTracerHook: Core HTTP request/response tracing
HTTPTracerHook
¶
Bases: Hook
Core hook for tracing all HTTP requests and responses.
This hook captures HTTP_REQUEST, HTTP_RESPONSE, and HTTP_ERROR events for both client-side (CCProxy → providers) and server-side (client → CCProxy) HTTP traffic. It uses injected formatters for consistent logging.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json_formatter
|
Any
|
JSONFormatter instance for structured logging |
None
|
raw_formatter
|
Any
|
RawHTTPFormatter instance for raw HTTP logging |
None
|
enabled
|
bool
|
Whether the hook is enabled |
True
|