The WebSocket connection to the Genesys AppFoundry endpoint closes immediately with code 4001. I’m passing the bearer token in the Sec-WebSocket-Protocol header as documented. The handshake succeeds, but the server rejects the upgrade before any data flows. Here’s the client config:
const ws = new WebSocket(url, {
headers: {
'Authorization': `Bearer ${token}`,
'X-Genesys-Auth-Token': token
}
});
Logs show the connection state goes from OPENING to CLOSED in under 200ms. No error event fires, just the close code. I’ve verified the token is valid against /api/v2/analytics/users/me. What’s wrong with the header setup?