How to access Websocket Response Headers in Javascript?

后端 未结 1 784
面向向阳花
面向向阳花 2021-01-19 19:09

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

相关标签:
1条回答
  • 2021-01-19 19:32

    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

    0 讨论(0)
提交回复
热议问题