MCPcopy Create free account
hub / github.com/code3-dev/dengvpn / stopV2ray

Function stopV2ray

main.js:922–942  ·  view source on GitHub ↗
(keepProxy = false)

Source from the content-addressed store, hash-verified

920}
921
922function stopV2ray(keepProxy = false) {
923 // Clear ping interval when disconnecting
924 if (pingInterval) {
925 clearInterval(pingInterval);
926 pingInterval = null;
927 }
928
929 if (v2rayProcess) {
930 // Disable system proxy before killing the process, unless we're keeping it
931 if (!keepProxy) {
932 disableSystemProxy();
933 }
934
935 v2rayProcess.kill();
936 v2rayProcess = null;
937 isConnected = false;
938 if (win) {
939 win.webContents.send('connection-status', false);
940 }
941 }
942}
943
944// Add a function to switch servers without full disconnect/connect cycle
945function switchServer(newConfigIndex) {

Callers 2

startV2rayFunction · 0.85
main.jsFile · 0.85

Calls 1

disableSystemProxyFunction · 0.85

Tested by

no test coverage detected