WebSocket

Zion·2022년 7월 10일
0

WebSocket

목록 보기
1/2

What is WebSocket?

The WebSocket Protocol enables two-way communication btw a client running untrusted code in a controlled environment to a remote host that has *opted-in to communications from that code.

WebSocket 프로토콜은 제어된 환경에서 신뢰할 수 없는 코드를 실행하는 클라이언트와 해당 코드의 통신에 *옵트인한 원격 호스트 간의 양방향 통신을 가능하게 합니다.

The security model used for this is the origin-based security model commonly used followed by basic message framing, layered over TCP.

이를 위해 사용되는 보안 모델은 일반적으로 사용되는 원본 기반 보안 모델이며 TCP를 통해 계층화된 기본 메시지 프레이밍이 뒤따릅니다.

The goal of this technology is to provide a mechanism for browser-based applications that need two-way communication with servers that does not rely on opening multiple HTTP connections (e.g, using XMLHttpRequest or <iframe>s and long polling.

이 기술의 목표는 여러 HTTP 연결(예: XMLHttpRequest 또는 <iframe> 사용 및 긴 폴링 사용)에 의존하지 않는 서버와의 양방향 통신이 필요한 브라우저 기반 애플리케이션에 메커니즘을 제공하는 것입니다.

WebSocket Ping Pong?

Description

A WebSocket server is an application which maintains long-lived connections with clients, because there can be long periods with no communication btw requests, the connection may be disconnected.

WebSocket 서버는 클라이언트와 오래 지속되는 연결을 유지하는 응용 프로그램입니다. 요청 간에 통신이 없으면 연결이 끊어질 수 있기 때문입니다.

To help keep WebSocket connections alive for long periods we can use Ping and Pong frames.

WebSocket 연결을 오랫동안 유지하기 위해 Ping 및 Pong 프레임을 사용할 수 있습니다.

This can be thought of as a *heartbeat mechanism, the client will send a ping frame to the server in response the server will pong back to the client, maintaining that connection over a long time.

→ 이것은 *heartbeat mechanism으로 생각할 수 있습니다. 클라이언트는 응답으로 서버에 Ping 프레임을 보내어 서버가 클라이언트로 다시 Pong Back 하여 오랜 시간 동안 해당 연결을 유지합니다.

Otherwise, if the ping/pong fails either party knows to disconnect the client.

그렇지 않고 ping/pong이 실패하면 어느 쪽이든 클라이언트의 연결을 끊는 것을 알 수 있습니다

WebSocket Ping Pong | Open Swoole PHP

Terminology

handshake :

an exchange of standardized signals between devices in a computer network regulating the transfer of data.

opt-in :

당사자가 개인 데이터 수집을 허용하기 전까지 당사자의 데이터 수집을 금지하는 제도이다. 기업과 같은 단체가 광고를 위한 메일을 보낼 때, 수신자의 동의를 얻어야 메일을 발송할 수 있도록 하는 방식도 옵트인(Opt-in)방식이다.

heartbeat mechanism :

In computer science, a heartbeat is a periodic signal generated by hardware or software to indicate normal operation or to synchronize other parts of a computer system.

컴퓨터 과학에서 하트비트는 정상적인 작동을 나타내거나 컴퓨터 시스템의 다른 부분을 동기화하기 위해 하드웨어 또는 소프트웨어에서 생성되는 주기적인 신호입니다.

Heartbeat (computing) - Wikipedia

profile
어제보다만 나아지는

0개의 댓글