improve flash socket, fixed socket buffer issues
add the javascript api which automatically uses WebSocket and falls back to flash