Register onopen callback on ws instance and emit 'open' event.