Using AutoHotKey to start and stop Wiresock connection?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #14272
    joq3
    Participant

      I tried setting up WireSock so that on startup it will be hidden in tray and autoconnect. And on closing the application it will disconnect the VPN.

      Using AutoHotKey to start the application and autoconnect works great. But closing it will not work. Either I cannot close the application or I manage to close it but the VPN is still connected in the background.

      Is there a way to do this without interacting with the application manually in the taskbar?

      #14285
      Vadim Smirnov
      Keymaster

        Could you please clarify what version of WSC do you use?

        #14286
        joq3
        Participant

          Version 3.4.6.1

          #14287
          Vadim Smirnov
          Keymaster

            Have you enabled Disconnect VPN when app closes option? What options do you have enabled under Startup & Auto-Connect?

            #14288
            joq3
            Participant

              Yes I have that enabled. But that only works when exiting the app correctly. If I right click the task bar icon and exit the app it disconnects correctly. But if I use AutoHotKey (same as Task manager force close) it will still be connected even if the application is gone from the taskbar.

               

              i got start minimized to tray and connect on app launch enabled! And the disconnect on exit.

              #14289
              Vadim Smirnov
              Keymaster

                This is expected behavior.

                The VPN  connection is managed by a background service that does not depend on the UI. On normal exit, the UI sends a disconnect command to the service before closing.

                If the UI process is force-killed, for example via AutoHotKey or Task Manager, it cannot send that command, so the service keeps running and the VPN tunnel stays connected.

                So disconnect on exit works for normal exits, but not when the UI is forcibly terminated.

                #14290
                joq3
                Participant

                  I understand why it works like it does. But is there any way for me to disconnect WireSock when closing the application with AutoHotKey?
                  I would love to have a keyboard shortcut from AutoHotKey which I can use to both exit the application and disconnect the VPN. Is it possible to do this somehow?

                  I previously used your WireSock application that did not have any UI, I think that version was 3 years old, here it worked well together with AutoHotKey to run a CMD command to connect and disconnect. But I cannot work out how to do it with the new version and the old version is no where to be found any longer.

                  #14291
                  Vadim Smirnov
                  Keymaster

                    If AutoHotkey lets you run a command-line action when the app is closed, you can use the CLI utility to disconnect the tunnel.

                  Viewing 8 posts - 1 through 8 (of 8 total)
                  • You must be logged in to reply to this topic.