TCP¶
Raw TCP mock server. Matches incoming data as exact string, prefix wildcard, or regex. Supports hex encoding for binary protocols.
protocols:
tcp:
enabled: true
port: 8083
mocks:
- id: ping
match: "PING\r\n"
response: "+PONG\r\n"
- id: hex-response
match: "re:^\\x02.*\\x03$"
response: "hex:060000"
See also¶
- Configuration — matching, templated responses, state conditions, and scenarios shared by every protocol
- Fault Injection — this protocol's fault fields:
response,delay,error_rate - Management API — mocks for this protocol follow the same CRUD pattern as HTTP mocks (
/api/mocks/{protocol})