Cannot make websocket connection. I use java. Server responds 400 Bad request without any useful information. All headers is filled and correct here is anonymized example:
GET /v1/realtime?model=gpt-4o-realtime-preview HTTP/1.1
Authorization: Bearer s*****A
OpenAI-Beta: realtime=v1
Content-Type: text/plain;charset=UTF-8
Sec-WebSocket-Version: 13
Sec-WebSocket-Key: 1731151100885
Host: api.openai.com
Origin: api.openai.com
Upgrade: websocket
Connection: Upgrade
Lines terminated by crlf one empty line at the end. Everything is correct from websocket protocol and OpenAI protocol. I expect success response or any details in response which says what’s wrong. But server answers:
HTTP/1.1 400 Bad Request
Date: Sat, 09 Nov 2024 11:22:08 GMT
Content-Type: text/plain
Content-Length: 189
Connection: keep-alive
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
CF-Cache-Status: DYNAMIC
Set-Cookie: __cf_bm=3V3Pgh3bvP_fQ1A8HjquGmxg30QdiVd_5D9.SP2y6.4-1731151328-1.0.1.1-3jCnvZjs1owmX6pFXQa63K7N2gMyPYPH4EbbZD3IWAbIxnguv3r2_PTEGPe6Wiz2Okl5y21HUkX4nuP226svwQ; path=/; expires=Sat, 09-Nov-24 11:52:08 GMT; domain=.api.openai.com; HttpOnly; Secure
X-Content-Type-Options: nosniff
Set-Cookie: _cfuvid=lJ1I7PXHuGsOVweblJKdDu4HYVuf.XtFK1Hqe6ovSiA-1731151328510-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
Server: cloudflare
CF-RAY: 8dfd6c57ad38a99b-LCA
alt-svc: h3=":443"; ma=86400
It says nothing. Please fix.