From 94b3f6adab367b6841f104c7ea002a362aada984 Mon Sep 17 00:00:00 2001 From: Vahid Farid Date: Fri, 31 May 2024 21:39:32 +0330 Subject: [PATCH] Update config.ts --- src/config.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/config.ts b/src/config.ts index 1a231e27..9b270a8b 100644 --- a/src/config.ts +++ b/src/config.ts @@ -7,7 +7,8 @@ export function MixConfig(cnf: Config, url: URL, address: string, provider: stri const hostname: string = MuddleDomain(url.hostname) try { let conf = {...cnf}; - if (!["ws", "h2", "http"].includes(conf.network)) { + const type = conf.network || conf.type || "" + if (!["ws", "h2", "http"].includes(type)) { throw new Error("Network is not supported!") } else if (!cfPorts.includes(conf.port)) { throw new Error("Port is not matched!") @@ -64,7 +65,7 @@ export function EncodeConfig(conf: Config): string { }?encryption=${ encodeURIComponent(conf.encryption || "none") }&type=${ - conf.network + conf.type || conf.network }${ conf.path ? "&path=" + encodeURIComponent(conf.path) : "" }${