Adds option to postpone immediate connect upon new(). That enables to set additional headers in supported targets.
Partialy solves #11, but is IMHO more versatile solution. Setting cookies (and other headers such as custom user agent) can be now done easily without hustle of overriding.
var cookies = ["session" => "ABCD"];
var ws = new WebSocket("wss://...", false);
ws.additionalHeaders.set(
"Cookie",
[for (k in cookies.keys()) '${k}=${cookies[k]}'].join("; ")
);
ws.open();
Adds option to postpone immediate connect upon new(). That enables to set additional headers in supported targets.
Partialy solves #11, but is IMHO more versatile solution. Setting cookies (and other headers such as custom user agent) can be now done easily without hustle of overriding.