-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
👀 Is there an existing feature request for this?
- I have searched the existing issues
🔖 Enhancement description
Add fine-grained port control for replay target resolution, specifically:
-
ssePort— A new top-level config field (test.ssePort) and CLI flag (--sse-port) that overrides the HTTP port for SSE (Server-Sent Events) test cases. SSE requests are detected viatext/event-streamin the response Content-Type or request Accept header. -
protocolsection — An extensible, map-based protocol config undertest.protocolthat allows per-protocol port overrides:test: protocol: http: port: 8000 sse: port: 8047 grpc: port: 8034
New protocols or new keys within a protocol can be added in the config file without code changes.
-
replaceWith.portmapping — A port-to-port mapping insidereplaceWith(both global and per-test-set) that acts as the highest-priority port override:test: replaceWith: global: port: 8033: 8043 test-sets: sse: port: 8033: 8043
Updated priority order (lowest → highest):
- Recorded
app_port test.port/test.grpcPort/test.ssePorttest.protocol.<proto>.portreplaceWithURL (if replacement contains explicit port)replaceWith.portmapping (highest, overrides everything)
🎤 Why should this be worked on?
Currently Keploy only supports a single port for all HTTP requests and a separate grpcPort for gRPC. When an application serves both regular HTTP and SSE endpoints on different ports, there is no way to route SSE test cases to a different port during replay.
Real-world use cases:
- Microservices with SSE: Apps that serve REST on one port and SSE (e.g. real-time notifications, AI streaming responses) on another.
- Protocol-aware routing: Different protocols may run on different ports in development vs production. The
protocolconfig enables this without jugglingreplaceWithURL rules. - Port migration during replay: When replaying against a different environment, the
replaceWith.portmapping provides a clean way to remap ports without rewriting full URLs.
💻 Repository
keploy