0

In windows I have a system variable http_proxy=a.b.c.d:8080 I need to bypass these proxy when I boot a service but I check and always has these variable. How could I bypass?

1 Answers1

0

Change the windows service to a service account that doesn't have the environment variable set,and then restart the service

Edit:

You can try to set the no_proxy environment variable for a specific domain set no_proxy=mycompany.com

Hopefully you are able to figure to which domain your service connects.

Turdie
  • 2,564
  • Problem is that is a system variable so I understand it’s impossible that any user don’t have the variable – Miguel7799 Dec 04 '23 at 21:21
  • Yes correct, it's also a bit odd to set a proxy using an system environment variable. Usually it's been done in the internet options in the control panel. Or using a group policy also setting the internet options. If the service communicates over a certain port you might be able create a bypass or exception in the proxy itself, or if it communicates with a certain known endpoint. – Turdie Dec 04 '23 at 21:27
  • Thanks! And is there no option to put http_proxy="" or something like that in user environment variables to override the sytem variable? – Miguel7799 Dec 04 '23 at 21:54
  • There might be, but if you keep that system environment variable it will take priority over the user environment variable and might even cause conflicts. Maybe you are able to host that service in a docker container or something like that? – Turdie Dec 04 '23 at 22:07
  • Impossible. I need to install in machine local witho docker and nothing like that – Miguel7799 Dec 04 '23 at 22:07
  • I found something i will update my post with a edit – Turdie Dec 04 '23 at 22:13
  • Thanks again, another problem is host dont have domain. It says me in the log, cannot connect to e URI "http://OPCT:511/twsz/JobScheduler/job". So I need to bypass OPCT host (without domain) – Miguel7799 Dec 04 '23 at 22:25
  • If you know the ip you can make something in the local host file like serviceopct.domain and then use that in the no proxy. Very nasty by way. C:\Windows\System32\drivers\etc\hosts. Or run network monitor or Wireshark and start the service and see where it tries to connect to by making a network capture – Turdie Dec 05 '23 at 01:08
  • Thanks! It solved with no_proxy in environment system variable. – Miguel7799 Dec 05 '23 at 08:44