Inspecting Docker HTTP Requests with Scapy and Netcat
Summary
The document explains two ways to inspect HTTP requests sent from a trading bot’s Docker environment while debugging exchange API errors. One method runs a Python packet sniffer with Scapy on the container’s network interface and logs request data. The other redirects requests to a local listener and uses Netcat to print them in a terminal. Examples illustrate inspecting a GET market-data request and a POST order request, including the path, headers, body, and authentication-related fields.
The techniques are presented as aids for diagnosing API calls when platform error messages alone are insufficient. The capture approach is limited to unencrypted HTTP; the article says HTTPS traffic cannot be captured this way because of platform processing. Redirecting a request to a local listener can expose its raw message for inspection, but the document does not discuss how to protect captured credentials or signatures. Its examples use a substituted host and demo credentials, so these should not be treated as live values.
Key ideas
- Scapy can log HTTP request contents from a Docker network interface for debugging.
- A local Netcat listener can display requests redirected to its port.
- Captured GET and POST messages expose paths, headers, and request bodies.
- The packet-capture method described does not inspect HTTPS traffic.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.