fix GH-207
undo removal of onclose for websocket api compattibility
update close event in README
Merge pull request #239 from mokesmokes/closefix

fix GH-207