mphx
mphx copied to clipboard
Node JS server target
JS already works with websockets on the client, it should work with node js on the server. Node JS is used very commonly on servers, so a JS mphx server only makes sense.
I'm not too sure how I will go about this. Node JS by itself can very easily make a tcp server, but with haxe that might be different. It has to be a raw tcp socket, it can't do any processing (like socket IO does), that is of course mphx's role.
https://github.com/clemos/haxe-js-kit seems most up to date in terms of externs, with commits just a few days ago. Using an external source for JS externs seems safest, as they can be maintained separately and issues about them can be raised there. Having externs in this library seems a little polluting. The externs can just be listed as a dependecy, and will be installed with mphx.
On the server side, there is the tcp server and then the websocket protocol. The websocket protocol is activated if the client is in the browser. The node js server would be an alternative to the tcp server (An interface could/should be used, like IClient). I think that using the websocket protocol code in mphx might still be a better option than using websocket externs, as that way all targets have consistent websocket behavior. If websockets are broken, they should be broken everywhere.
Flash client is is still priority for now, however this would be nice to achieve in the longer run.