From 3d974345a291a77aca36b01b0e0ade7b99ba4683 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sun, 24 Nov 2019 01:16:07 +0100 Subject: [PATCH] Added option to removed DNS-Proxy --- shared/js/settings.ts | 5 +++++ web/js/connection/ServerConnection.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/shared/js/settings.ts b/shared/js/settings.ts index 41950e2a..549c74e2 100644 --- a/shared/js/settings.ts +++ b/shared/js/settings.ts @@ -212,6 +212,11 @@ class Settings extends StaticSettings { key: 'connect_history' }; + static readonly KEY_CONNECT_NO_DNSPROXY: SettingsKey = { + key: 'connect_no_dnsproxy', + default_value: false + }; + static readonly KEY_CERTIFICATE_CALLBACK: SettingsKey = { key: 'certificate_callback' }; diff --git a/web/js/connection/ServerConnection.ts b/web/js/connection/ServerConnection.ts index 0e732640..2c9d3bc9 100644 --- a/web/js/connection/ServerConnection.ts +++ b/web/js/connection/ServerConnection.ts @@ -140,7 +140,7 @@ namespace connection { else if(Modals.Regex.IP_V6.test(address.host)) proxy_host = address.host.replace(/\[(.*)]/, "$1").replace(/:/g, "_") + ".con-gate.work"; - if(proxy_host) + if(proxy_host && !settings.static_global(Settings.KEY_CONNECT_NO_DNSPROXY)) local_proxy_socket = new WebSocket('wss://' + proxy_host + ":" + address.port); local_direct_socket = new WebSocket('wss://' + address.host + ":" + address.port);