I have a question which path should I follow.
I want to develop real time online game via webbrowsers.
I would want to write game server using C++ with TCP sockets listening. The client side game will be written in javascript. The only problem I dont know how to communicate javascript with c++ server using TCP sockets. I have considered using Socket.IO but as far as I know this library does not have option to just connect to real TCP server, push bytes through and read incoming ones. Instead I would need to use some wrapper like Node.JS server which I want to avoid.
Anyone could guide me which path I should take?
You could make your game server itself an HTTP server. For the most part it could just serve up your static files, but when it received a WebSocket upgrade request, it could handle that however it desired.
You should take a look to websockify:
websockyfy is a WebSocket to TCP proxy/bridge. This allows a browser to connect to any application/server/service. Implementations in Python, C, Node.js and Ruby.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.