Compare commits
2 Commits
c4c1fd8f6b
...
3a41474b26
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | 3a41474b26 | |
Derrick Hammer | 339dbba08c |
|
@ -158,7 +158,7 @@ class MultiSocketProxy extends proxy_js_1.default {
|
||||||
async onmessage(m) {
|
async onmessage(m) {
|
||||||
if (self._allowedPorts.length &&
|
if (self._allowedPorts.length &&
|
||||||
!self._allowedPorts.includes(m.port)) {
|
!self._allowedPorts.includes(m.port)) {
|
||||||
self.get(await this._getPublicKey(peer)).messages.errorSocket.send({
|
self.get(await self._getPublicKey(peer)).messages.errorSocket.send({
|
||||||
id: m.id,
|
id: m.id,
|
||||||
err: new Error(`port ${m.port} not allowed`),
|
err: new Error(`port ${m.port} not allowed`),
|
||||||
});
|
});
|
||||||
|
@ -166,7 +166,7 @@ class MultiSocketProxy extends proxy_js_1.default {
|
||||||
}
|
}
|
||||||
m = m;
|
m = m;
|
||||||
if (self._server) {
|
if (self._server) {
|
||||||
new self.socketClass(nextSocketId(), m, self, self.get(await this._getPublicKey(peer)), m).connect();
|
new self.socketClass(nextSocketId(), m, self, self.get(await self._getPublicKey(peer)), m).connect();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const socket = self._sockets.get(m.id);
|
const socket = self._sockets.get(m.id);
|
||||||
|
|
|
@ -200,7 +200,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(await this._getPublicKey(peer)).messages.errorSocket.send({
|
self.get(await self._getPublicKey(peer)).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`
|
||||||
|
@ -216,7 +216,7 @@ export default class MultiSocketProxy extends Proxy {
|
||||||
nextSocketId(),
|
nextSocketId(),
|
||||||
m,
|
m,
|
||||||
self,
|
self,
|
||||||
self.get(await this._getPublicKey(peer)) as PeerEntity,
|
self.get(await self._getPublicKey(peer)) as PeerEntity,
|
||||||
m
|
m
|
||||||
).connect();
|
).connect();
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue