rSimulate / Cosmosium

:earth_americas: js game engine for space-based games
Other
23 stars 7 forks source link

Cross Domain Problem showing WebGL #88

Closed iontom closed 9 years ago

iontom commented 9 years ago

When I run on my linux machine, and try to access across LAN, I no longer am being served the WebGL scene.

So 192.168.1.9:7099/play and then in place of the webgl scene is just black but the UI is still there.

sceneprob

BrianErikson commented 9 years ago

I'm not sure the cross-domain thing is an issue. It worked with no hitches on the dev server. Make sure if you change the port, you change it in both line 582 and 73 in app.py. The dev server was acting the exact same way until I configured those lines for the dev server. If not, it may be some firewall port-blocking issues?

7yl4r commented 9 years ago

I'm fairly certain that going cross-domain without changing HOST or PORT in the config file will break websockets at least. It's possible that the websocket issue brings down the whole scene since the javascript might hit some var undefined errors.

BrianErikson commented 9 years ago

I don't think that's the case fortunately. Bottle and websockets seem to work fine together, since they both operate over port 80 as far as I know. Cross-domain becomes an issue when the server is operating over multiple ports. I originally brought up a possible cross domain issue because AJAX GET(file) requests operate over a different port than 80 (FTP possibly), and that breaks the server. But playerObjects is no longer utilizing AJAX for the GET requests. It all operates over bottle routing and websockets.

7yl4r commented 9 years ago

well I know that I had to change HOST to asteroid.ventures on the production branch in order to get the websockets to work. I think this is because that domain name is sent to the client. So when you leave HOST=localhost, the client application is trying to websocket connect to your own machine. If you want to connect from another client, then you need to change HOST to your IP or domain name.

BrianErikson commented 9 years ago

Right. I believe that is line 73 in app.py.

iontom commented 9 years ago

What would you change in config file? The base URI?

7yl4r commented 9 years ago

No, I'd change HOST to your server's IP. The other stuff in there is back from when we were playing with oauth I think.

BrianErikson commented 9 years ago

This issue may have been fixed with latest merge. It changes the way the content is loaded over webGL, so it's worth another shot.

EDIT: Hah. Or just completely break Firefox...

BrianErikson commented 9 years ago

I think it's safe to say that this solution has been resolved. Please feel free to re-open if we run into this issue again.