웹 소켓

웹 소켓은 사용자의 브라우저와 서버 사이의 인터액티브 통신 세션을 설정할 수 있게 하는 고급 기술입니다. 개발자는 웹 소켓 API를 통해 서버로 메시지를 보내고 서버의 응답을 위해 서버를 폴링하지 않고도 이벤트 중심 응답을 받는 것이 가능합니다.

인터페이스

WebSocket

웹 소켓 서버로 연결하고 연결을 통해 데이터를 보내고 받는 기본 인터페이스<

CloseEvent

연결이 종료 되었을 때 웹 소켓 객체에 의해 전달된 이벤트

MessageEvent

서버로 부터 메시지가 수신 되었을 때 웹 소켓 객체에 의해 전달된 이벤트

도구

관련 주제

같이 보기

브라우저 호환성

api.WebSocket

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
WebSocket
WebSocket() constructor
url parameter allows https, http, and relative URLs
binaryType
bufferedAmount
close
close event
error event
extensions
message event
open event
protocol
Supports protocol as specified by RFC 6455
readyState
send
url
Available in workers

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.
Requires a vendor prefix or different name for use.
Has more compatibility info.

api.WebSocketStream

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
WebSocketStream
Experimental
WebSocketStream() constructor
Experimental
close
Experimental
closed
Experimental
opened
Experimental
url
Experimental

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.