Forum GameFS HTTP vs HTTPS: JavaScript API Failure

Discussion and help relating to the PlayerIO game asset hosting and CDN solution, GameFS.

HTTP vs HTTPS: JavaScript API Failure

Postby AK712 » October 10th, 2020, 2:36 pm

I am attempting to use the Example - Multiplayer - Chat game with the PlayerIO Sitebox, and there appears to be an HTTP error when loading the URL as HTTPS. I'm wondering, can this be fixed to be more secure? When replacing the "index.html" file with the "Game.htm" code from the example, the following error comes in with Firefox's Console:

Blocked loading mixed active content “http://api.playerio.com/json/” PlayerIOClient.development.js:22:14

If I go into the game's Sitebox, click the link, then change the "https://" to "http://", the game works fine.
User avatar
AK712
 
Posts: 34
Joined: May 2nd, 2012, 12:43 am

Re: HTTP vs HTTPS: JavaScript API Failure

Postby Henrik » October 13th, 2020, 10:12 pm

You have to set this flag to true for the SDK to use HTTPS for all API calls: https://playerio.com/documentation/refe ... piRequests

And a corresponding one for multiplayer websocket connections: https://playerio.com/documentation/refe ... onnections
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: HTTP vs HTTPS: JavaScript API Failure

Postby AK712 » October 15th, 2020, 12:06 am

Whoops! I didn't see those! Thanks for the help, it all works now. :D
User avatar
AK712
 
Posts: 34
Joined: May 2nd, 2012, 12:43 am

Re: HTTP vs HTTPS: JavaScript API Failure

Postby Henrik » October 15th, 2020, 10:04 am

No worries, we should probably default those flags to true for the JS client library at least, since HTTPS is pretty much the standard these days, and browsers won't allow mixed content anymore.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm


Return to GameFS