简体   繁体   English

为什么在JavaScript WebSocket上看不到协议数组?

[英]Why I can't see the array of protocol on javascript WebSocket?

As you can see, sec-WebSocket-Protocol display "a, b" as string, but from the WebSocket Object, there is only 'a'; 如您所见,sec-WebSocket-Protocol将“ a,b”显示为字符串,但是在WebSocket对象中,仅显示“ a”; why? 为什么?

在此处输入图片说明

The WebSocket.protocol read-only property returns the name of the sub-protocol the server selected; WebSocket.protocol只读属性返回服务器选择的子协议的名称。 this will be one of the strings specified in the protocols parameter when creating the WebSocket object. 这将是创建WebSocket对象时在protocols参数中指定的字符串之一。

~ MDN, WebSocket.protocol 〜MDN,WebSocket.protocol

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM