HTML5 + Networking behaviours
Armelline
Member, PRO Posts: 5,354
Is this working currently? I'm getting no response to networking requests that work in Creator and on device. This is pretty urgent. @adent42
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Comments
Ah I just rememebered about the CORS stuff. Guess I have to relearn all that.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
While you're developing I find the easiest thing is to open it all up. For instance we're using FastApi in our glitches and we just do:
Which translates to the headers:
For this project I don't have direct access to the glitch so this is still up in the air for me but much appreciated, will pass it on and bookmark for inevitable later use!
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
It turned out to be more than CORS that was causing problems and I'll give a brief explanation here for anyone else having this issue. If you write your own server code there's a good chance you'll bypass it, but I was lazy and using the Glitch server python code that was provided, which has always worked a treat for me with iOS/Android published games.
When Creator etc. send a POST request (network send table) they include a sig in the request. When HTML5 sends one it does not.
I don't know if there's somewhere I could or should have added one in the HTML5 project, but once the requirement is removed from the Glitch server code, it accepts POSTs from HTML5 published projects just fine.
GET / network get table is not affected by this.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Nice one @Armelline appreciate the explanation as to what was causing your issue.
GameSalad Templates and Custom Development at the Official Marketplace: http://gshelper.com