Could it be with the headers?
The ConnectSocket talks about the HTML5 using an HTTP style header.
The SetHTTPHost talks about the difference in the iSecure for the HTTP vs HTTPS
Just wondering if it is trying to use a non secure HTTP connection which is causing your error, then maybe the header could make the difference.
I have only dabbled in the networking stuff, so chances are you a leaps ahead of me, so apologies in advance if I am not being helpful, just throwing thoughts blindly.
EDIT
Probably way off, but was thinking setting something to be secure first for the HTTPS may override that ws to a wss
Probably not, just wondering
Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1