         session: "audio-video-data"
         direction: "many-to-many"
       )
+      connection.onmessage = (e) ->
+        appendDIV(e)
       connection.onstream = (stream) ->
         $(".js-accept-webrtc").hide()
         video = getVideo(stream)

showAlertUnsupported = ->
  $('.js-no-webrtc').removeClass('hide').show() 
  $('.js-accept-webrtc').hide()

checkWebRTCSupport = ->

        initConnection()
        connection.open()
        window.isRoomInitiator = true
    chatInput = document.getElementById('chat-input')
    chatInput.onkeypress = (e) ->
      if (e.keyCode != 13 || !this.value)
        return
      appendDIV(this.value);
      connection.send(this.value)

      this.value = ''
      this.focus()
