Closed hongyi-zhao closed 3 years ago
It looks like your problem is not related to transocks.
Yes/maybe. I mean why can't I purely based on iptables to achieve all the work transocks does.
Both SOCKS and HTTP proxy are application protocols. Hence an application needs to speak the protocol if they need to connect to such a server.
transocks is a program to translate bare TCP communications into SOCKS or HTTP requests. You can't do this with iptables.
Both SOCKS and HTTP proxy are application protocols.
Why the DNS query can be solved purely based on iptables just as I've mentioned above? Do you mean DNS proxy isn't an application protocol?
It's because the DNS query packet is just routed to the DNS server.
SOCKS and HTTP proxy servers are not the final destination. They are just transits, and you need to speak a special proxy protocol to use such a transit.
If so, why not purely rely on transocks to do the whole job and remove the needs for dependent on iptables?
transocks needs iptables to redirect packets to itself. transocks cannot do this by itself because it is a userland program.
Thanks a lot for clarifying my doubt. Another question: there is another similar project for the same purpose called redsocks. What's the difference between this two projects?
We first tried to use redsocks actually, and found that it is not quite stable for a large amount of traffics. So we developed transocks as an alternative.
We are running this in our production environments for years w/o problems.
Thanks a lot. Got it. I'll try to solve my problems with transocks.
Hi,
On Ubuntu 20.04, I've docker installed working the way of the default bridge network, as shown below:
At the same time, I use systemd-resolvd stub resolver as the host network DNS server, as shown below:
With the following settings done on the host, I can use the host network DNS server in the docker container via setting 172.17.0.1 as the DNS server:
But I want to extend this method to the case of using the host network socks5/http servers in docker container, say, socks5 server on 127.0.0.1:18888 and http server on 127.0.0.1:8080, by setting the following iptables rules:
But, this method doesn't get me to use the host socks5/http servers in docker container with the following forms:
Any hints for this problem will be highly appreciated.
Sincerely, HY