13 lines
327 B
JavaScript
13 lines
327 B
JavaScript
|
|
peer.on('connection', function(conn) {
|
|
console.log(conn.peer+" has connected to me")
|
|
conn.on('open', function() {
|
|
peerlist[conn.peer]=conn
|
|
console.log(peerlist)
|
|
// Receive messages
|
|
conn.on('data', function(data) {
|
|
handleData(conn,data,"Their Connection")
|
|
})
|
|
})
|
|
})
|