fix: check protocol with colon

This commit is contained in:
Derrick Hammer 2023-08-31 02:34:59 -04:00
parent 17ff5fd96b
commit a4b692b28f
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 4 deletions

View File

@ -466,8 +466,8 @@ export class P2PService {
unsupported.protocol = "unsupported";
const connectionUri =
connectionUris.find((uri) => ["ws", "wss"].includes(uri.protocol)) ||
connectionUris.find((uri) => uri.protocol === "tcp") ||
connectionUris.find((uri) => ["ws:", "wss:"].includes(uri.protocol)) ||
connectionUris.find((uri) => uri.protocol === "tcp:") ||
unsupported;
if (connectionUri.protocol === "unsupported") {
@ -497,8 +497,8 @@ export class P2PService {
try {
this.logger.verbose(`[connect] ${connectionUri}`);
if (protocol === "tcp") {
const ip = connectionUri.host;
if (protocol === "tcp:") {
const ip = connectionUri.hostname;
const port = parseInt(connectionUri.port);
const socket = await tcpConnect(port, ip);