Webcast WSS ws_reuse_supplement
Purpose
Direct live websocket stream for web TikTok LIVE clients.
Endpoint
- hosts:
webcast-ws.eu.tiktok.comwebcast-ws.us.tiktok.comwebcast-ws.tiktok.com
- method: websocket upgrade
- path:
/webcast/im/ws_proxy/ws_reuse_supplement/
Observed Query Parameters
version_code=180800device_platform=webcookie_enabled=truescreen_width=1920screen_height=1080browser_language=en-USbrowser_platform=Linux x86_64browser_name=Mozillabrowser_version=5.0 (X11)browser_online=truetz_name=Europe/Bucharestor runtime timezoneapp_name=tiktok_websup_ws_ds_opt=1update_version_code=2.0.0compress=gzipwebcast_language=enws_direct=1aid=1988live_id=12- second observed
version_code=270000 app_language=enclient_enter=1room_id={room_id}identity=audiencehistory_comment_count=6last_rtt={100-200ish}heartbeat_duration=10000resp_content_type=protobufdid_rule=3
Observed but not currently canonical as required:
X-Bogus
Handshake Headers
HostUpgrade: websocketConnection: UpgradeSec-WebSocket-KeySec-WebSocket-Version: 13User-AgentReferer: https://www.tiktok.com/Origin: https://www.tiktok.comAccept-LanguageAccept-EncodingCookie: ttwid=...optionally with extra session cookies appended
Cookie Findings
Three successful cookie tiers are documented :
- documented minimum:
ttwidalone - older successful reduced browser subset:
ttwid,tt_chain_token,msToken,sessionid,sid_tt - full browser jar in Firefox capture: 26 to 27 cookies
The canonical minimum for current direct web WSS is still ttwid alone.
Confirmed Handshake Outcomes
- success: HTTP
101 Switching Protocols - missing cookie:
Handshake-Msg: named cookie not present,Handshake-Status: 417 - blocked cookie:
Handshake-Msg: DEVICE_BLOCKED,Handshake-Status: 415 - missing
aid:Handshake-Msg: illegal app_id,Handshake-Status: 417 - missing
ws_direct=1orsup_ws_ds_opt=1:Handshake-Msg: illegal secret key,Handshake-Status: 417 - wrong path such as
/webcast/im/fetch/:404 Not Found
Additional Observations
- page-captured direct WSS uses no
cursor - page-captured direct WSS uses no
internal_ext - page-captured direct WSS uses no
msTokenin the websocket URL - push-server responses are documented with
Server: nginx - curl-based upgrade testing must use HTTP/1.1; HTTP/2 can obscure valid-upgrade behavior
Initial Client Frames
hb- payload:
HeartbeatMessage { room_id } - full builders set outer frame defaults
seq_id=0,log_id=0,service=0,method=0,headers={},payload_encoding="pb"
- payload:
im_enter_room- payload:
WebcastImEnterRoomMessage { room_id, live_id=12, identity="audience", cursor="", account_type=0, enter_unique_id=0, filter_welcome_msg="0", is_anchor_continue_keep_msg=false } - full builders use the same outer defaults as
hb
- payload:
ack- sent only after server
msgframes that carryneeds_ack=trueand non-emptyinternal_ext - reuses the server frame
log_id - payload is raw
internal_extbytes
- sent only after server
Server Payload Types
im_enter_room_respmsghb
When msg payloads are gzip-compressed protobuf:
- decode outer
WebcastPushFrame - decompress payload if gzip magic bytes are present
- decode
WebcastResponseor a closely related lite fetch container - if
needs_ackandinternal_extexist, sendack
Observed direct-WSS WebcastResponse fields:
messagescursorfetch_intervalnowinternal_extfetch_typeroute_params_mapheart_beat_durationneeds_ackpush_serveris_firsthistory_comment_cursorhistory_no_more
Stable inner message families already decoded successfully :
- chat
- like
- gift
- member
- room viewer sequence
- social/share
- live intro
- control
- envelope/treasure
Related Pages
- Webcast Fetch
- Webcast im/push
- Webcast Room Enter
- Webcast im/fetch
- TTWID Alone Is Sufficient For Web WSS
- ws_direct Bypasses im/fetch
- Mobile Webcast WSS
Related reading 23
- C / FFI
- C#
- Connection & authentication
- Connection lifecycle
- Dart
- Elixir
- Endpoint reference
- Go
- Java
- JavaScript / TypeScript
- Lua
- Mobile Webcast WSS
- PowerShell
- Python
- Rust
- Shell
- TTWID Alone Is Sufficient For Web WSS
- Troubleshooting
- Webcast Fetch
- Webcast Room Enter
- Webcast im/fetch
- Webcast im/push
- ws_direct Bypasses im/fetch