From 0a202004c432b08a17ca5d0f43e087c3097a7f14 Mon Sep 17 00:00:00 2001
From: rui hildt
Date: Thu, 1 Feb 2024 18:41:32 +0100
Subject: [PATCH] Fix selection of proxy server per host
---
.../ConnectionDetails/ConnectionDetails.vue | 6 +-
src/components/Location.vue | 4 +-
src/components/ProxyStatus/ProxyHost.vue | 57 ++++----------
src/composables/useSocksProxy.ts | 75 +++++++++++--------
src/helpers/socksProxy.ts | 23 +++---
src/popup/App.vue | 16 +---
src/popup/views/Home.vue | 20 ++++-
7 files changed, 97 insertions(+), 104 deletions(-)
diff --git a/src/components/ConnectionDetails/ConnectionDetails.vue b/src/components/ConnectionDetails/ConnectionDetails.vue
index ba855f60..38ab9a11 100644
--- a/src/components/ConnectionDetails/ConnectionDetails.vue
+++ b/src/components/ConnectionDetails/ConnectionDetails.vue
@@ -14,7 +14,7 @@ import DnsLeakStatus from '@/components/ConnectionStatus/DnsLeakStatus.vue';
import { ConnectionKey, defaultConnection } from '@/composables/useConnection';
import useSocksProxy from '@/composables/useSocksProxy';
-const { globalProxyEnabled, activeTabProxyEnabled } = useSocksProxy();
+const { globalProxyEnabled } = useSocksProxy();
const { isLoading, isError, connection } = inject(ConnectionKey, defaultConnection);
const connected = computed(() => connection.value.isMullvad);
@@ -34,7 +34,7 @@ const connected = computed(() => connection.value.isMullvad);
-
+
The connection is set to use a proxy server.
If you can't load any pages, try disabling the proxy to access the internet directly
@@ -45,7 +45,7 @@ const connected = computed(() => connection.value.isMullvad);
-
+
The connection is set to use a proxy server.
If you can't load any pages, try disabling the proxy to access the internet directly
diff --git a/src/components/Location.vue b/src/components/Location.vue
index 1ed8c38d..acbd90a1 100644
--- a/src/components/Location.vue
+++ b/src/components/Location.vue
@@ -15,7 +15,7 @@ import type { HistoricConnection } from '@/composables/useHistoricConnections/Hi
const { activeTabHost } = useActiveTab();
const { hostProxySelect, toggleLocations } = useLocations();
const { proxiesList } = useListProxies();
-const { setHostProxy, setGlobalProxy } = useSocksProxy();
+const { setCurrentHostProxy, setGlobalProxy } = useSocksProxy();
const { storeSocksProxyUsage } = useHistoricConnections();
const currentOrAllWebsites = computed(() =>
@@ -33,7 +33,7 @@ const setProxy = (
toggleLocations();
if (hostProxySelect.value) {
- setHostProxy({ country, city, hostname, ipv4_address, port }, activeTabHost.value);
+ setCurrentHostProxy({ country, city, hostname, ipv4_address, port }, activeTabHost.value);
} else {
setGlobalProxy({ country, city, hostname, ipv4_address, port });
}
diff --git a/src/components/ProxyStatus/ProxyHost.vue b/src/components/ProxyStatus/ProxyHost.vue
index 7f3a5f2c..5cbf4d9c 100644
--- a/src/components/ProxyStatus/ProxyHost.vue
+++ b/src/components/ProxyStatus/ProxyHost.vue
@@ -1,10 +1,9 @@