         @conn.on 'close', @onClose
         @conn.on 'error', errorHandler
 
+    peer        : () =>
+        return @conn.peer
+
     onOpen      : () =>
 
     onData      : (data) =>
-        @emitter.trigger data.type, data
+        @emitter.trigger data.type, data.params
 
     onClose     : () =>
 
     send        : (type, data) =>
-        @conn.send { type: type, data: data }
+        @conn.send { type: type, params: data }
 
     close       : () =>
         do @conn.close

        @call.on 'stream', @onStream
        @call.on 'close', @onClose
        @call.on 'error', errorHandler

    onStream    : (stream) =>
        data =

            for peer in data.peers
                @pjs.connect peer.id
        @emitter.on 'peer.dataconnection', (event, data) =>
            if !@peers[do data.dc.peer]?
                @peers[do data.dc.peer] = {}
            @peers[do data.dc.peer].dc = data.dc
            # @sendStreamState do data.dc.peer
        @emitter.on 'peer.mediaconnection', (event, data) =>
            if !@peers[do data.mc.peer]?
                @peers[do data.mc.peer] = {}
            @peers[do data.mc.peer].mc = data.mc
        @emitter.on 'peer.remove', (event, data) =>
            if @peers[data.id]?
                @removePeer data.id
