Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / [HTML5] ConnectSocket does not use wss://

Author
Message
OrangeTEK
4
Years of Service
User Offline
Joined: 7th Aug 2019
Location:
Posted: 11th Sep 2020 10:07
Most websites are hosted over HTTPS these days. If your HTML5 AppGameKit app needs to connect to a Websocket Server using 'ConnectSocket', it will need to use wss:// in its javascript url to connect. When i export a project using 'ConnectSocket', the code is translated to ws:// which throws an error. This should be fixed as it renders any type of multiplayer for HTML5 useless. It would be even better if a set of simple WebSocket commands was included for cross platform apps, ass many platforms these days use WebSocket for communications.
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 11th Sep 2020 18:21 Edited at: 11th Sep 2020 18:47
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
OrangeTEK
4
Years of Service
User Offline
Joined: 7th Aug 2019
Location:
Posted: 11th Sep 2020 18:42 Edited at: 11th Sep 2020 19:03
I dint think of that. I'll give it a go.

update.

Nah, not gonna work. The SetHTTPHost() command expects a http connection id. I think the docs for ConnectSocket refer to what the html5 version does in the background. I already have a websocket server programmed from scratch in Purebasic. I was planning on porting it to AppGameKit for fun but probably not worth it until this is fixed.
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 11th Sep 2020 19:36
Quote: "Nah, not gonna work. The SetHTTPHost() command expects a http connection id. I think the docs for ConnectSocket refer to what the html5 version does in the background. "

Figured the background thing, and was why I was unsure/wondering about the override thing.

Sorry it wasn't any help, but didn't hurt to try..


Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1

Login to post a reply

Server time is: 2024-04-19 03:29:08
Your offset time is: 2024-04-19 03:29:08