π Is there an existing feature request for this?
π 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 via text/event-stream in the response Content-Type or request Accept header.
-
protocol section β An extensible, map-based protocol config under test.protocol that 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.port mapping β A port-to-port mapping inside replaceWith (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.ssePort
test.protocol.<proto>.port
replaceWith URL (if replacement contains explicit port)
replaceWith.port mapping (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
protocol config enables this without juggling replaceWith URL rules.
- Port migration during replay: When replaying against a different environment, the
replaceWith.port mapping provides a clean way to remap ports without rewriting full URLs.
π» Repository
keploy
π Is there an existing feature request for this?
π 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: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:Updated priority order (lowest β highest):
app_porttest.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
portfor all HTTP requests and a separategrpcPortfor 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:
protocolconfig enables this without jugglingreplaceWithURL rules.replaceWith.portmapping provides a clean way to remap ports without rewriting full URLs.π» Repository
keploy