IP for multiplayer HTML5 running on browser

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By rodicausa

I ran a multiplayer on my laptop setting it up as a server. Now, I need to run the multiplayer HTML5 in a browser (chrome). I have uploaded the file to itch.io for testing. The game requests an IP. What IP do I need to use?
I am new to Godot and networking and I would really appreciate your help. Thank you

:bust_in_silhouette: Reply From: oj

Hi, unfortunately as per security limitations you’d have to host html pages and Godot backend on the same server.
Please note that this isn’t a Godot limitation per se, but rather a browsers’ security feature that is not going to change. You will have to use a more complete hosting solution eg. a cloud vps.


This is not really due to security limitations, but rather that native applications and Web browsers use different protocols to communicate (the former uses UDP in Godot with the high-level multiplayer API, whereas the latter uses WebSockets which is slower).

Calinou | 2019-01-31 15:49

I must admit I don’t know how OP have implemented his game but I think he could port it anyway to WebSocketServer (otherwise that is, no html multiplayer at all). Origin policies et al. are a much rigid obstacle though, given they are security features. So it wast just my 2c about that :slight_smile:

oj | 2019-01-31 16:04

Thank you for your reply!

rodicausa | 2019-02-03 14:06