Skip to main content

Access differences between WebSocket and TCP

LongPort support WebSocket and TCP feed, the differences:

  • Data of TCP is streaming, so coding client is hard than WebSocket.
  • WebSocket using URL Query to Handshake
  • WebSocket using ping-pong to do Heartbeating, instead of sending heartbeat packet.
  • WebSocket using TLS to secure connection, but TCP do not.

User can choice TCP or WebSocket on self demand.

Advice: Using WebSocket first, it is more simple. If want more quick stock quote real-time pushing, using TCP to access stock quote gateway.