Fix #5, Websocket constructor exception and small refactoring
Merge pull request #6 from Hellov/master

Fix #5, Websocket constructor exception and small refactoring