* Update references from peer.socket to peer.stream in multiSocket.ts.
This commit is contained in:
parent
40e139df0d
commit
13ff64002d
|
@ -130,7 +130,7 @@ export default class MultiSocketProxy extends Proxy {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const pubkey = this._toString(peer.socket.remotePublicKey);
|
const pubkey = this._toString(peer.stream.remotePublicKey);
|
||||||
|
|
||||||
if (this._peers.has(pubkey)) {
|
if (this._peers.has(pubkey)) {
|
||||||
this._peers.delete(pubkey);
|
this._peers.delete(pubkey);
|
||||||
|
@ -188,7 +188,7 @@ export default class MultiSocketProxy extends Proxy {
|
||||||
self._allowedPorts.length &&
|
self._allowedPorts.length &&
|
||||||
!self._allowedPorts.includes((m as TcpSocketConnectOpts).port)
|
!self._allowedPorts.includes((m as TcpSocketConnectOpts).port)
|
||||||
) {
|
) {
|
||||||
self.get(peer.socket.remotePublicKey).messages.errorSocket.send({
|
self.get(peer.stream.remotePublicKey).messages.errorSocket.send({
|
||||||
id: (m as SocketRequest).id,
|
id: (m as SocketRequest).id,
|
||||||
err: new Error(
|
err: new Error(
|
||||||
`port ${(m as TcpSocketConnectOpts).port} not allowed`
|
`port ${(m as TcpSocketConnectOpts).port} not allowed`
|
||||||
|
@ -204,7 +204,7 @@ export default class MultiSocketProxy extends Proxy {
|
||||||
nextSocketId(),
|
nextSocketId(),
|
||||||
m,
|
m,
|
||||||
self,
|
self,
|
||||||
self.get(peer.socket.remotePublicKey) as PeerEntity,
|
self.get(peer.stream.remotePublicKey) as PeerEntity,
|
||||||
m
|
m
|
||||||
).connect();
|
).connect();
|
||||||
return;
|
return;
|
||||||
|
@ -218,7 +218,7 @@ export default class MultiSocketProxy extends Proxy {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
this.update(peer.socket.remotePublicKey, {
|
this.update(peer.stream.remotePublicKey, {
|
||||||
messages: { openSocket: message },
|
messages: { openSocket: message },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -231,7 +231,7 @@ export default class MultiSocketProxy extends Proxy {
|
||||||
self._sockets.get(m.id)?.push(m.data);
|
self._sockets.get(m.id)?.push(m.data);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
this.update(peer.socket.remotePublicKey, {
|
this.update(peer.stream.remotePublicKey, {
|
||||||
messages: { writeSocket: message },
|
messages: { writeSocket: message },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -244,7 +244,7 @@ export default class MultiSocketProxy extends Proxy {
|
||||||
self._sockets.get(m.id)?.end();
|
self._sockets.get(m.id)?.end();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
this.update(peer.socket.remotePublicKey, {
|
this.update(peer.stream.remotePublicKey, {
|
||||||
messages: { closeSocket: message },
|
messages: { closeSocket: message },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -258,7 +258,7 @@ export default class MultiSocketProxy extends Proxy {
|
||||||
self._sockets.get(m.id)?.emit("timeout");
|
self._sockets.get(m.id)?.emit("timeout");
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
this.update(peer.socket.remotePublicKey, {
|
this.update(peer.stream.remotePublicKey, {
|
||||||
messages: { timeoutSocket: message },
|
messages: { timeoutSocket: message },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -272,7 +272,7 @@ export default class MultiSocketProxy extends Proxy {
|
||||||
self._sockets.get(m.id)?.emit("error", m.err);
|
self._sockets.get(m.id)?.emit("error", m.err);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
this.update(peer.socket.remotePublicKey, {
|
this.update(peer.stream.remotePublicKey, {
|
||||||
messages: { errorSocket: message },
|
messages: { errorSocket: message },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue