Websockets Overview

Introduction

The WebSocket protocol (introduced with HTML5) revolutionizes client-server communication by enabling full-duplex connectivity. Unlike traditional methods, it allows for simultaneous, two-way data streaming through a single, persistent connection established via an initial handshake.


Connectivity

  • Base URL:wss://stream-api.osl.com
  • Public Stream: wss://stream-api.osl.com/openapi/v1/ws
  • Private Stream: wss://stream-api.osl.com/openapi/v1/ws/user

Connection Limits

The following restrictions apply to the WebSockets connections.

LimitValue
Single connection request frequency limit25 times/second
Request message size limit:

Text message: max 4096 bytes, min 4 bytes

Binary message: max 1024 bytes, min 4 bytes

Heartbeat timeout:120 seconds without response, automatically disconnected
Heartbeat data sending method:

Request:ping (lowercase)

Response: {"pong": 1760499659155} (response to the system timestamp of the pong field)

No subscription timeout:No subscription will be automatically disconnected within 24 hours|