Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Internet when PC start if Green Tunnel was on and wasn't closed manually before shutdown #168

Open
fx-pro opened this issue Apr 15, 2023 · 3 comments

Comments

@fx-pro
Copy link

fx-pro commented Apr 15, 2023

Scenario:

  • Open Green Tunnel.
  • Turn it On.
  • Shutdown PC (Green Tunnel will be force closed automatically).
  • Start PC again (without GT in startup).
  • No Internet connection.

Suggest solution:
Green Tunnel go Off if closed by Windows when shutdown.

Thank you very much for such a great app!

@musjj
Copy link

musjj commented Apr 23, 2023

The program manually sets the system's proxy settings (as seen in src/utils/system-proxy.js) when you run it. If you exit cleanly, it will turn it back off, but otherwise the proxy settings will be left as it was when the program was running.
I don't think there's anything that Green Tunnel can do about this, but I suppose it can provide a convenient command line option to toggle the proxy.

@fx-pro
Copy link
Author

fx-pro commented Apr 25, 2023

@musjj
Thank you for your kindly support. I understand that GTunnel set the proxy for the system, and it isn't clean up when closed by Windows when Shutdown.
But Windows don't kill all the processes immediately when PC shutdown, however, it send signal to all running process to let them deal with it/clean up...

In node.js application, we can handle those signals likes:

function shutdownHandler(signal) {
    // do some stuff here
    
   await unsetProxy();
    
   //process.exit()
}

process.on('SIGINT', shutdownHandler)
process.on('SIGTERM', shutdownHandler)
process.on('SIGQUIT', shutdownHandler)

Thank you,

@junsukim1994
Copy link

@musjj
How do you exit 'cleanly' like in your comment? Now I have to turn gt from my terminal to connect to the App Store every time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants