Ylianst/MeshAgent

Meshagent over http proxy in linux

Opened this issue · 3 comments

Hello! Thank you for meshcentral. This is a super convenient device management tool.

I have a problem connecting an agent on a remote machine to a meshcentral server via http proxy. Debian 12 is installed on the machine. There are no problems with a direct connection and the agent successfully connects to the server. If I transfer this computer behind a proxy server, the agent does not connect.
On the agent side, I edit the meshagent.msh file and add the WebProxy=http://10.0.68.52:3128/ option. I tried different options with and without http://. With and without quotes. The agent still does not connect to the server.

I tried removing the WebProxy option and passing environment variables to meshagent.service:

[Service]
Environment="http_proxy=http://10.0.68.52:3128/"
Environment="https_proxy=http://10.0.68.52:3128/"
Environment="HTTP_PROXY=http://10.0.68.52:3128/"
Environment="HTTPS_PROXY=http://10.0.68.52:3128/"

This didn't give me any results.

Here is the agent log:

[2023-11-02 02:13:06 PM] [434BF98C5D4F394C] microstack/ILibParsers.c:10978 (0,0) PLATFORM_TYPE: 1
[2023-11-02 02:13:06 PM] [434BF98C5D4F394C] microstack/ILibParsers.c:10978 (0,0) Running as Service: 1
[2023-11-02 02:13:06 PM] [434BF98C5D4F394C] meshcore/agentcore.c:4296 (0,0) Attempting to connect to Server...
[2023-11-02 02:13:06 PM] [434BF98C5D4F394C] meshcore/agentcore.c:4299 (0,0) Attempting to connect to Server...
[2023-11-02 02:13:06 PM] [434BF98C5D4F394C] microstack/ILibParsers.c:10978 (0,0) Connecting to: wss://myserver:5580/agent.ashx
[2023-11-02 02:13:26 PM] [434BF98C5D4F394C] microstack/ILibParsers.c:10978 (0,0) Network Timeout Occurred...
[2023-11-02 02:13:26 PM] [434BF98C5D4F394C] microstack/ILibParsers.c:10978 (0,0) Control Channel Disconnected [13]...
[2023-11-02 02:13:26 PM] [434BF98C5D4F394C] meshcore/agentcore.c:3726 (0,0) Connection Error [0x25ead58, 0, [13]]...

Tell me how to still force the agent to use a proxy server?

have you tried this method of a text file? Ylianst/MeshCentral#321 (comment)

have you tried this method of a text file? Ylianst/MeshCentral#321 (comment)

Thank you for trying to help!
I created a meshagent.proxy file and specified the proxy address 10.0.68.52:3128 in it. Restarted the agent. But the agent still doesn't connect. Other utilities such as wget, curl, apt work properly through this proxy. In Windows there is no such problem with the agent. I check the auto proxy box and the agent connects properly. The problem is only in Linux.

Hi Team,
I have installed meshcentral server using docker image and server is running fine on my.domain.com

I have downloaded agent and installed on windows machine
image

after running agent , it shows its running fine in vm-group-a

But on server in this group it is NOT showing

kindly guide how i can fix this issue

I have added hosts file in windows and route ping all is working fine w.r.t connectivity.

Some one please help what is the issue here in configuration

thanks
srikanth