Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Payload ¶
type Payload struct { Kind string `json:"kind"` // Type of the message Body any `json:"body"` // Content of the message }
Payload represents the structure of WebSocket messages.
type Server ¶
type Server struct { // URL is the proxy server's URL URL *url.URL `json:"url"` // Disabled indicates whether the server is disabled (1) or enabled (0) Disabled uint32 `json:"disabled"` // Capacity represents the maximum number of concurrent requests this server can handle Capacity int `json:"capacity"` // Latency is the last measured response time in milliseconds Latency int `json:"latency"` // Requests is the current number of active requests being processed Requests int `json:"requests"` // Positive is the count of successful requests processed by this server Positive int `json:"positive"` // Negative is the count of failed requests processed by this server Negative int `json:"negative"` // contains filtered or unexported fields }
Server represents a proxy server with its current state and performance metrics.
type Stat ¶
type Stat struct { // Targets is the total number of URLs to process Targets int `json:"targets"` // RPM represents the current requests per minute RPM int `json:"rpm"` // Servers contains a map of active proxy servers and their statistics Servers map[string]srvMap `json:"servers"` // contains filtered or unexported fields }
Stat represents the global statistics for the application.
func (*Stat) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for Stat Returns:
- []byte: JSON representation of the statistics
- error: Any error that occurred during marshaling
type Worker ¶
type Worker struct { // Interval defines the time (in seconds) between proxy downloads and health checks. Interval int `default:"300"` // Port specifies the HTTP server port for the web interface Port int `default:"8080"` // Workers determines the number of parent workers. // - In "minimal" strategy, it represents the maximum number of concurrent connections. // - In "auto" strategy, it defines the number of parent workers, while child workers // are dynamically allocated based on proxy server capacity. // // Example (minimal): // If Workers == 100, then max concurrent requests == 100. // // Example (auto): // If Workers == 50 and each proxy server supports 100 concurrent connections, // then max concurrent requests == 5000. Workers int `default:"100"` // Sources contains a map of proxy source URLs grouped by schema (http/https/socks4/socks5) Sources proxySrc `validate:"required"` // StatInterval defines the interval (in seconds) for updating statistics. StatInterval int `default:"2"` // Strategy determines the load balancing approach: "minimal" or "auto". // // - "minimal" Single-threaded mode, suitable for proxies with limited concurrency. // - "auto" Dynamically adjusts concurrency based on proxy capabilities. Strategy string `default:"minimal"` // Timeout specifies the request timeout in seconds Timeout int `default:"10"` // URL used for testing the connection TestTarget string `validate:"required"` // contains filtered or unexported fields }
Worker represents a worker instance that manages proxy servers and request processing.
Click to show internal directories.
Click to hide internal directories.