07.01 / 60 min

Configure WebSocket connections

Build a reproducible upgrade request with identity, origin, cookies, headers, TLS, and subprotocol decisions.

By the endInspect the upgradeApply identity correctlyControl transport lifecycle
Controlled exercise

Use only the Academy Lab on 127.0.0.1:5177. Do not copy these tests to a public system without explicit written authorization.

01

Prove the target boundary

Create or reopen the Academy Lab project and send GET /health. Continue only when the target is 127.0.0.1 and local_only is true. The public-recon lessons require a separately authorized target and are never run against an unrelated domain.

GET http://127.0.0.1:5177/health
Expected result

200 with "local_only": true.

02

Connect anonymously

Use /ws and preserve the HTTP upgrade request and first connected frame. Record URL, Origin, headers, cookies, and selected subprotocol.

03

Connect as an identity

Select User A through stored identity state, not a placeholder Authorization header. Verify the connected frame names user_a.

04

Test Origin policy

Use /ws-secure with the allowed lab origin and then a foreign origin. Compare /ws-insecure. Keep every other handshake field identical.

05

Set lifecycle limits

Configure a short connection timeout, bounded event queue, explicit cancel, no infinite retry, and a capped reconnect count. Confirm Cancel closes the worker activity.

06

Inspect WSS separately

On an authorized WSS target, verify TLS chain and hostname with the TLS module. The defensive CLI does not provide a separate WSS certificate validator.

MASTERY CHECKPOINT

Prove it before moving on.

The connection record explains authentication, Origin, TLS, subprotocol, timeout, cancel, and reconnect behavior independently.