#304·websocat

autoreconnect with --preamble

Author: safonoviCreated Feb 9, 2026Updated Feb 9, 2026
Labelsenhancement

Hi, vi! Thanks for the websocat. For connection to the websocket, I use the following line:

websocat -t - autoreconnect:wss://ws_server/state/ --preamble '{"type": "auth", "data": "tocken"}'

The first connection is successful, but subsequent reconnections (after connection is lost) are rejected by the server, as if I didn't provide authentication data.

websocat -V websocat 1.14.1