fsocket javascript implementation