SOSTrace — now in JS!

It was brought to my attention by a comment in a previous article that my HaXe trace target should be platform agnostic (I think that’s the right term). In particular, he wanted a trace target for JS and PHP. Well I’m happy to report it took about 5 minutes to add JS support! PHP will have to wait a bit, as the interface for PHP sockets is a bit different, but its day will come soon enough.

The interface hasn’t changed a bit, but in order to get your JS HaXe project set up with SOSTrace, you’ll have to add a short, unfortunate blurb to your compile.hxml. Basically, we still have to use Flash’s XMLSocket class, since JavaScript WebSockets are still a ways off. HaXe has foreseen this need and included a nice way of using a simple Flash file as a proxy, just add this to your compile.hxml file:

-swf flashsocket.swf
haxe.remoting.SocketWrapper

Head over to github to get the latest source.

3 Comments

  1. Alan Klement

    Very cool.

    I began looking into it myself; however, I was trying to avoid using a .swf but I gave up. I’m glad you went ahead and created it with the .SWF anyway.

    I’m going to use this…..

Comments are closed.