Flash/Neko Chat Example
Here's a small code example showing how you can quickly develop a Realtime Chat using a haxe/Flash Client and a haxe/Neko commandline Server that communicates using Haxe Remoting. This package contains the following files :
ClientApi.hx
: the API that the Server can call on the ClientServerApi.hx
: the API that the Client can call on the ServerClient.hx
: the haxe/Flash Client Implementation, uses XMLSocketServer.hx
: the haxe/Neko Server Implementation, uses ThreadRemotingServerapp.hxml
: the HXML file to compile the projectserver.n
andserver.bat
: neko binary and batch file to start the serverclient.swf
andclient.html
: the precompiled flash client.
Please open the HTML after starting the server and follow the instructions. The source code is very small (4 KB) and should be a good start for people wanting to develop realtime applications.
Download
remoting_chat_example_swf9.zip (For flash9-11 haxe 2-3)
Legacy flash 8 example. Flash 8 target is not the default target anymore, so edit the file app.hxml
to target flash 8 instead of flash 9 with the -swf-version 8
compilation option.
Trouble shooting
If you don't load the client from domain localhost you have to change host in both: Server.hx and Client.hx. Then the flash socket policy files will be served correctly.
Also read the Summary of Flash Security arcticle.