Superatons Posted April 30, 2020 Share Posted April 30, 2020 (edited) facebook allows socket.io and expres? i have an instant game in process, when i run the game this happens and this the code: Edited May 2, 2020 by Superatons Quote Link to comment Share on other sites More sharing options...
momcina Posted May 2, 2020 Share Posted May 2, 2020 You should place socket.io.js in your project. And then link that file with relative path: <script src="./socket.io/socket.io.js"></script> This should work fine. You can't reference .js files on some other server Quote Link to comment Share on other sites More sharing options...
Superatons Posted May 2, 2020 Author Share Posted May 2, 2020 44 minutes ago, momcina said: You should place socket.io.js in your project. And then link that file with relative path: <script src="./socket.io/socket.io.js"></script> This should work fine. You can't reference .js files on some other server a few minutes ago update the project and the localhost works but when uploading it to facebook the game does not load and this happens: Quote Link to comment Share on other sites More sharing options...
momcina Posted May 2, 2020 Share Posted May 2, 2020 I have just try this example code from socketio github <script src="/socket.io/socket.io.js"></script> <script> var socket = io('http://localhost'); socket.on('connect', function(){}); socket.on('event', function(data){}); socket.on('disconnect', function(){}); </script> And I can confirm it is working. Maybe something else is the problem. Quote Link to comment Share on other sites More sharing options...
Superatons Posted May 2, 2020 Author Share Posted May 2, 2020 (edited) yes, something's got to be wrong but i don't notice it, everything works on localhost but when i upload it to facebook it's when the errors appear,I'm using this archives an index i have this socket.js and app.js Edited May 2, 2020 by Superatons Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.