Websockets or long-polling in backend #Rawabi

I’m trying to make a multiplayer game, since it does not seem for me that in the backend i can use websockets i decided to go for long polling, however no matter how i try to make it succeed i always fail in the back end, i have tried a while loop, a setInterval, and delay by sending consecutive promises ,none of these methods worked for me, i can’t debug the server side code easily because my access to logs is really limited, it seems for me that by design your backend is refusing my long-polling code.

I have also tried to use short-polling but it did not work for me, seems there is a quota on server usage.

My question is does your back-end allow websockets or long-polling?

#Rawabi

Hi,

Unfortunately, web sockets are currently not supported by Wix Code.
Regarding polling,
You can go that way, but note that Wix Code will allow a limited number of requests (a lot, but still limited to a reasonable use)… this means that your polling should have a reasonable interval.

Having said that,
Note that you can however bundle your own files and paste them to Wix Code site.
So let’s say you really need a web socket, you can use ‘browserify’ for example to bundle one into a file for the front end, and deploy your own server (on Heroku, for example) for backend.

Liran.