How to access Websocket response headers in Javascript?

I need to access the response header from a javascript website connection. Is there any way to access this response header? Or at least a response code?

I have access to the onclose, onerror, onopen event with several properties (unsuitable for my purposes)!

+4
source share
1 answer

You can not. There is no functionality at the moment. The WebSockets point is not an HTTP connection. HTTP is used only for a handshake.

https://developer.mozilla.org/en-US/docs/Web/API/WebSocket

+4
source

Source: https://habr.com/ru/post/1536093/


All Articles