genotrance / px

An HTTP proxy server to automatically authenticate through an NTLM proxy
MIT License
955 stars 99 forks source link

Is there a way to restart the proxy (Windows)? #185

Closed weibeld closed 9 months ago

weibeld commented 1 year ago

On Windows 10, assuming the proxy has been installed to run on startup with px.exe --install and the system has started up, is there a way to manually restart the proxy while it is already running?

genotrance commented 1 year ago

There isn’t a —restart option right now. You can use —quit and then start Px again. As long as it is the same Px binary (same location), it should stop and start with the same configuration.

genotrance commented 1 year ago

I’m just curious why you need to restart a running proxy? Wondering if you have changed settings and want them to take or some other reason? We could add a flag but would be good to know why first.

weibeld commented 1 year ago

No, the use case was restarting the proxy when there is a network change like connecting or disconnecting from a VPN. Not sure if the proxy is designed to handle this.

genotrance commented 1 year ago

I don’t think there’s a real need for this - Px reloads proxy information that is discovered every 60 seconds using —proxyreload. The timeout is configurable as well if you need. I think it should handle such VPN changes.

Curious to hear if this does not meet your needs.

weibeld commented 1 year ago

I use Px proxy to provide internet access to WSL2 through a company network. When I log in to Windows and after that establish a VPN connection, then the proxy information is updated, as you said, however, I don't have internet access from WSL2. In particular, I can't reach the network interface that Px proxy is listening on from WSL2.

It only works if the VPN connection is established before logging in to Windows, i.e. before Px proxy is started.

genotrance commented 1 year ago

I'm not sure I understand this - are you saying that if the VPN is connected before Px starts, everything works fine but Px does not handle the switch if the VPN is started afterwards?

Does this have something to do with https://github.com/genotrance/px/issues/173?

genotrance commented 9 months ago

This is added in v0.9.0.