Connection refused, have to restart service periodically

Hi, I am using boringproxy to forward a few of my self hosted services, and no matter what I do, I have to manually restart it, as I get a connection refused error. Nothing shows up in the terminal, besides a few “CertMagic error at startup” messages, but it doesn’t seem to affect it. So the problem I am facing: Every now and then I have to restart the service on the client, because I get a connection refused error when trying to reach any of the sites I am forwarding.

Hi @SierraThePotato, my guess is this is related to this. Unfortunately boringproxy still doesn’t have builtin client restarts. You might find some helpful ideas in that thread though.

Thank you! I will try writing a script, and see if it helps.

The problem is if the vps where server is running is REBOOTED, clients must be restarted.

I believe it can also happen if the network goes down.

Okay, so I tried to solve it with crontab, and it seems to be working.

*/5 * * * * curl -f --max-time 5 -s --insecure -I [address] && echo good > /dev/null || systemctl restart boring.service

For me there are two cases: a subdomain timeouts, or it gives a connection refused error.
This command utilizes the timeouts. I know the /dev/null part is unnecessary, but I keep it there in case I need to manually test it.

1 Like

This looks like a solid solution to me, thanks for sharing!

1 Like