func (s *Socket) onClose(event js.Value) {
	if reason := event.Get("reason"); !reason.IsUndefined() && len(reason.String()) != 0 {
		s.log.Warning("left lobby: " + reason.String())
	}
	s.closeWebSocket()
}
// onMessage is called when the websocket is closing.
onMessage is called when the websocket is closing.
// onMessage is called when the websocket is closing .
func (s *Socket) onClose(event js.Value) {
	if reason := event.Get("reason"); !reason.IsUndefined() && len(reason.String()) != 0 {
		s.log.Warning("left lobby: " + reason.String())
	}
	s.closeWebSocket()
}
func ( s * Socket ) onClose ( event js . Value ) { if reason := event . Get ( " " ) ; ! reason . IsUndefined ( ) && len ( reason . String ( ) ) != 0 { s . log . Warning ( " " + reason . String ( ) ) } s . closeWebSocket ( ) }
onMessage is called when the websocket is closing.
onMessage is called when the websocket is closing .