Most lag removed from the MPHX multiplayer library.
At github, mphx is a multiplayer library for haxeflixel. At that homepage the library is said to have lag issues. I removed most lag. The lag was created from the example file called movement . Now there is only a slight delay between moving the player and that same player moving at the other client. The library can be downloaded from my fork . Copy the downloaded mphx folder to the root of your project. The updated example file is here. At the example file, I also added onConnectionClose, disconnect event and function setExitHandler which will disconnect a player from other clients when that player closes the program.
The example file was tested with 4 open clients. Note that a fair amount of lag still exists with tcp. Udp is therefore the default. You can change back to tcp at mphx\client\impl\TcpClient.hx.