   catch error
     s = new MozWebSocket(ws_conn_string)
   s.onopen = () ->
-    s.send(JSON.stringify({msgtype : 'subscribe', topic : topic}))
+    s.send(
+      JSON.stringify(
+        msgtype : 'subscribe'
+        topic : topic
+        auth : apikey
+      )
+    )
   s.onmessage = (msg) ->
     msgobj = JSON.parse(msg.data)
     if msgobj['msgtype'] == 'modelpush'


  return null

Continuum.submodels = (ws_conn_string, topic) ->
  # ###function : Continuum.submodels
  # creates a websocket which subscribes and listens for model changes
  # #####Parameters

        clientid = msgobj['status'][2]
        Continuum.clientid = clientid
        $.ajaxSetup({'headers' : {'Continuum-Clientid' : clientid}})
    else
      console.log(msgobj)
    return null
  return s

