From fc150d2c01f7fb1cd8ee63b46a3c12e5e4e1df4d Mon Sep 17 00:00:00 2001 From: Xzandro Date: Sun, 11 Feb 2024 21:50:17 +0100 Subject: [PATCH] Flush dns after hosts modifications --- app/proxy/SWProxy.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/proxy/SWProxy.js b/app/proxy/SWProxy.js index 6c5b3e4..f9fbc7e 100644 --- a/app/proxy/SWProxy.js +++ b/app/proxy/SWProxy.js @@ -12,6 +12,7 @@ const Proxy = require('http-mitm-proxy'); const { differenceInMonths } = require('date-fns'); const storage = require('electron-json-storage'); const { addHostsEntries, removeHostsEntries } = require('electron-hostile'); +const { exec } = require('child_process'); const { decrypt_request, decrypt_response } = require('./smon_decryptor'); @@ -55,6 +56,7 @@ class SWProxy extends EventEmitter { }), { name: 'SWEX' } ); + exec('ipconfig /flushdns'); const proxyHost = '127.0.0.1'; const proxyPort = port; @@ -255,6 +257,8 @@ class SWProxy extends EventEmitter { }), { name: 'SWEX' } ); + + exec('ipconfig /flushdns'); } getInterfaces() {