This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

WebSocket: protocol 속성

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2015년 7월⁩.

참고 : 이 기능은 Web Worker에서 사용할 수 있습니다.

WebSocket.protocol 은 읽기 전용 속성으로 서버에서 선택한 sub-protocol 의 이름을 반환합니다. 이는 WebSocket 객체 생성 시 protocols 매개변수에 지정된 문자열 중 하나이거나, 연결이 설정되지 않은 경우 빈 문자열입니다.