Skip to content

Configuring Proxy on an Agent

Introduction

You can configure a agent to use a proxy seperate from the system proxy. When you configure a proxy on the agent that does not touch the system proxy settings and other applications on the system have no access to this proxy configuration. If the system already has a proxy configured you can configure the agent proxy to have the agent use different proxy configuration. Without configuring the agent specific proxy the agent follows the system configuration.

Configuration

Here is how you actually configure the proxy. User and Password are optional and depend your proxy configuration, you would need to get those values from the proxy administrator. In the example below the port number for the sample proxy is 1234. Use nanitor-agent (nanitor-agent.exe on Windows), not nanitor-agent-bin. If the agent was installed with version 3.7.0 (March 2023) or later, the runner always runs the latest installed agent version, so you do not need to look up the version folder. If it prints an error such as No help topic, unknown flag or unknown shorthand flag instead of the expected output, see Finding your agent version manually. If you need to change the proxy configuration, just run this again and it will overwrite the existing config.

"c:\Program Files\Nanitor\Nanitor Agent\nanitor-agent.exe" proxy-set user:[email protected]:1234
sudo /opt/nanitor-agent/bin/nanitor-agent proxy-set user:[email protected]:1234
sudo /Library/Nanitor/Nanitor\ Agent/nanitor-agent proxy-set user:[email protected]:1234

If successful you should get a response like Proxy URL successfully set to: proxy.company.com:1234

Check that the response shows your proxy address. Then run info and check that Proxy Server shows [Config]: followed by your proxy. If it does not, see Finding your agent version manually.

Clearing the configuration

To remove the agent proxy configuration and revert to the system system, just run proxy-clear.

"c:\Program Files\Nanitor\Nanitor Agent\nanitor-agent.exe" proxy-clear
sudo /opt/nanitor-agent/bin/nanitor-agent proxy-clear
sudo /Library/Nanitor/Nanitor\ Agent/nanitor-agent proxy-clear

If successful you should get a response like Proxy URL successfully cleared

Checking configuration

The best way to see what is configured is to run the info command. You can also check the configuration file. See https://kb.nanitor.net/AgentTroubleshooting/ on how to find the configuration file. Here is how to run the info command.

"c:\Program Files\Nanitor\Nanitor Agent\nanitor-agent.exe" info
sudo /opt/nanitor-agent/bin/nanitor-agent info
sudo /Library/Nanitor/Nanitor\ Agent/nanitor-agent info

The output should look like this

2023/03/07 15:43:07 agent_database.go:783: ▶ D 0x1 Running agent-database open
Proxy Server: None
Agent version: 3.7.0.zzzz
Server URL: https://demo.nanitor.com/api
UUID: 55d8c476-9a07-47c3-5f2b-889316624aef
Shadow Activity: false
Data Directory: /var/lib/nanitor/agent
LogFile: /var/log/nanitor/nanitor_agent.log