[英]How to access Websocket Response Headers in Javascript?
I need to access the response header from a javascript websocket connection. 我需要从javascript websocket连接访问响应头。 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! 我只能访问onclose,onerror,onopen的事件,有一些(无法使用 - 用于我的目的)属性!
You can't. 你不能。 There is no functionality for that at the moment.
目前没有任何功能。 The point of WebSockets is not HTTP communication.
WebSockets的重点不是HTTP通信。 HTTP is only used for the handshake.
HTTP仅用于握手。
https://developer.mozilla.org/en-US/docs/Web/API/WebSocket https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.