Closed PhilipHayes closed 8 years ago
Any reason you don't want to use our WebSockets module from https://github.com/vapor/engine?
Oh I'll have to look into this, I was following the documentation and ended up with Socks instead.
Okay so I replaced my server with the engine one, and my javascript client now lists itself as connected. but it seems that any communication that happens for 'onopen' doesn't happen.
This is definitely closer, Its the sample code from engine and the sample code from the html5 web socket.
I'm using an html client because I'm working with Rot.js as a front-end for my server. (I want to be able to replace the front-end with things like Unity or Simple DirectMedia Layer for games.)
This slackbot written in Vapor uses websockets: https://github.com/vapor/penny
That might help you more. Websockets should be perfect for a real-time game.
Excellent, I think i've got it all running now! I'm going to get to building my app. Thank you for your guidance!
So I've started up a TCP server with socks and a TCP Client with straight Javascript.
I get the initial request from my javascript client to my Socks server, but however I have no idea what to send back to the javascript client to allow it to upgrade and begin sending and receiving data. I've had this issue with various WebSocket clients of not being able to complete the connection...
In Socks what should I do? my server is basically the sample code you've provided, and the client is the sample code provided here: http://www.tutorialspoint.com/html5/html5_websocket.htm
ironically, I do get the disconnect message when I turn off my server.
I also tried using the Socks TCPSocket Client and I get roughly the same issue, I can send the first message, and then nothing works after that.