This is a tiny Go app meant to reproduce the Keploy replay failure where an OPTIONS CORS preflight to an SSE endpoint (recorded on port 8047) is replayed against the normal HTTP port (8000) and returns 404.
:8000(normal HTTP): only servesGET /health(everything else is404):8047(SSE): serves:OPTIONS /subscribe/student/events→200+ CORS headers (notext/event-streamContent-Type)GET /subscribe/student/events→200+Content-Type: text/event-stream
cd sse-preflight
go run ./cmd/serverIn another terminal:
go run ./cmd/client --url "http://localhost:8047/subscribe/student/events?doubtId=repro" --host "doubt-service.example.com"You should see status=200 OK.
Prereq: make sure Keploy Enterprise auth is configured (for example KEPLOY_API_KEY), otherwise keploy record/test will prompt for an API key.
Terminal A:
keploy record -c "go run ./cmd/server"Terminal B (during the 20s window):
go run ./cmd/client --url "http://localhost:8047/subscribe/student/events?doubtId=repro" --host "doubt-service.example.com"keploy test -c "go run ./cmd/server"Expected: the preflight testcase fails with EXPECT 200 vs ACTUAL 404, and in debug logs you should see the key part:
Overriding port with app_port(8047)Config port overrides recorded app_port(8000 overrides 8047)Final resolved targetuseslocalhost:8000/...