 
     componentWillMount: ->
         who = getSegments()[1]
-        console.log "who: #{ who }"
 
         peer = new Peer who, key: PEER_KEY, debug: 2
-        console.log "new Peer()"
 
         @connections = []
 

            alert error.type

        peer.on "open", (peerId) =>
            console.log "peer.on"
            console.log "peerId: #{ peerId }"

            if who == "x"
                console.log "acting as #{ who }, host"

                peer.on "connection", (connection) =>
                    console.log "new connection"
                    console.log "peer #{ connection.peer } just connected to host #{ peerId }"

                    @connections.push connection



                    peerIds = @connectionsToPeerIds @connections


                    connection.on "open", =>
                        connectionsWithoutNewConnection = _.filter @connections, (c) -> c.peer != connection.peer
                        peerIdsWithoutNewConnection = @connectionsToPeerIds connectionsWithoutNewConnection

                        if peerIdsWithoutNewConnection.length

                            connection.send type: "newConnection", peerIds: peerIdsWithoutNewConnection

            if who != "x"

                peer.on "connection", (connection) =>


                    connection.on "open", =>


                        @connections.push connection

                        @listenForMessage connection

                connection = peer.connect "x"

                connection.on "error", (error) =>
                    alert error

                connection.on "open", =>

                    @connections.push connection

