There are are lot of excellent answers to this question which involve setting iptables routes on the router. However I need to set up the iptables routes on the client.
I'm working on an embedded system. This is connected to the internet using ppp and a GPRS modem. The system runs an application that makes https requests via libcurl.
I now need to route those https requests through a transparent https proxy server hosted somewhere on the internet. I've set up an https proxy with squid and ssl_bump, and I've verified that it's all working as expected.
There are various ways of routing the https requests through the proxy e.g. I can rebuild the application and configure libcurl to use the proxy server via CURLOPT_PROXY. But I'm wondering if it might be simpler and more flexible to set up a route to forward everything sent to the HTTPS port to the proxy.
The closest question I've seen is How do I configure a transparent proxy where the proxy server is remote? but this requires the route to contain the IP address of the client. As this is a GPRS connection which will come and go, the IP address will be unknown and will change from time to time.