Native websocket close code is always undefined. v3.5.2

Any idea what is happening?

It does not matter if i close a socket from a server or from a client.

this.socket = new WebSocket(url)
this.socket.onclose = (ev: CloseEvent) => this.onClose(ev)

Here the CloseEvent.code always is undefined

On which platform

I checked only iOS and Mac os.

Currently, part of websocket APIs are not in consisence with standard interface. We’ ll check and corret these part of APIs.
You can track our progress through: Native implementation of WebSocket is not the same as web · Issue #12286 · cocos/cocos-engine · GitHub