How about moving line 8 inside the loop. That way each web socket will connect individually.
The way you have it now, you will only get one WS_CONNECTED for one of the sockets, no guarentee which one.
Alternatively, you could move the WS_CONNECTED to its own sub.