Can handle paralell websockets in the same thread
Cleaned the code from ws4py dependencies