twampyre plugin | http

The http plugin performs HTTP/HTTPS GET or POST requests to a target URL, measuring web service responsiveness, availability, and optionally validating the content using a regex pattern. It uses the requests library and runs in a threaded execution mode.

Note
TLS certificate verification is enabled by default. Self-signed certificates must be explicitly allowed via enforce_tls: false.

✨ Key Features

  • Threaded HTTP/HTTPS client based on requests
  • Supports:
  • GET and POST methods
  • Custom request headers
  • Optional request body (for POST)
  • Optional response pattern matching using regex
  • Configurable TLS certificate verification
  • Custom port and path/query string support
  • Collects:
  • Request latency (response time)
  • Success/failure metrics
  • Basic response validation

⚖ License

Licensed under the BSD 3-Clause License.

🧩 Plugin Configuration

The http plugin currently has no plugin-level options, but this may change in future versions.

🧪 Session Parameters

These parameters apply per session (per target) and allow full customization of the HTTP request.

Name Type Default Description
scheme "http" or "https" "https" Protocol scheme
request str Request URI path and query (e.g. "/status?detail=full")
port int 80 / 443 Custom port (defaults to 80 or 443 based on scheme)
method "GET" or "POST" "GET" HTTP method
headers dict Optional HTTP headers
body str Body payload (for POST requests)
pattern str Optional regex to match against response body
enforce_tls bool true Enforce TLS certificate validation

🛠 Usage Example

plugins:
  http: {}

kinds:
  webserver:
    http:
      method: GET
      interval: 10.0
      timeout: 2.0

targets:
  apple.com:
    kind: webserver
  amazon.com:
    kind: webserver
  google.com:
    kind: webserver
    http:
      request: /search