I have been using Glassfish 4 as my server. I am opening a WebSocket connect using this statement:
webSocket = new WebSocket(link);
Where: