From d1c7f53d161d8e8419ca05852df89f6cac637e9d Mon Sep 17 00:00:00 2001 From: Sam Sneed <163201376+sam-sneed@users.noreply.github.com> Date: Tue, 13 Aug 2024 17:32:05 -0500 Subject: [PATCH] Only create proxy once --- main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 81b66dd..0d3ca98 100644 --- a/main.js +++ b/main.js @@ -113,8 +113,10 @@ const regexPatterns = [ } // set/create local proxy - const proxy = createProxy(http.createServer()); - proxy.listen(3129) + try { + const proxy = createProxy(http.createServer()); + proxy.listen(3129) + } catch {} session.defaultSession.setProxy({ proxyRules: 'http=localhost:3129;https=localhost:3129',