Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access Websocket Response Headers in Javascript?

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

I only have access to the event of onclose, onerror, onopen with a few (unusable - for my purposes) properties!

like image 883
Loxone Thomas Avatar asked Apr 11 '14 11:04

Loxone Thomas


1 Answers

You can't. There is no functionality for that at the moment. The point of WebSockets is not HTTP communication. HTTP is only used for the handshake.

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

like image 169
vtortola Avatar answered Oct 06 '22 03:10

vtortola