Just found transocks which transparently socksifies everything coming from an iptables rule so everything can go to desproxy-socks4 which converts it to CONNECT methods which any HTTP proxy accepts.
In other words, it is possible to transparently send ALL tcp/ip traffic to a HTTP proxy, HTTPS would be accepted too as if it came from a browser with the proxy specified in its settings.
This is one step from being solved, here's the iptables rules that should work with transocks, taken from
here:
LOCAL_NET=192.168.0.0/16
iptables -t nat -X SOCKSIFY
iptables -t nat -N SOCKSIFY
#Exceptions
iptables -t nat -A SOCKSIFY -o lo -j RETURN
iptables -t nat -A SOCKSIFY --dst 127.0.0.1 -j RETURN
iptables -t nat -A SOCKSIFY --dst $LOCAL_NET -j RETURN
#Avoid feedback loops
iptables -t nat -A SOCKSIFY -m owner --cmd-owner transocks -j RETURN
#Log
iptables -t nat -A SOCKSIFY -j LOG -p tcp --syn --log-level info \
--log-prefix "SOCKSify "
#Send to transocks
iptables -t nat -A SOCKSIFY -p tcp -j REDIRECT --to-port 1211
# Socksify traffic leaving this host:
iptables -t nat -A OUTPUT -p tcp --syn -j SOCKSIFY
# Socksify traffic routing through this host:
iptables -t nat -A PREROUTING -p tcp -s $LOCAL_NET --syn -j SOCKSIFY
Except I do not know enough about iptables to know where in the firewall script to put these rules. Can they just go where my old PREROUTING rule went (a rule mentioned in the beginning)?