Score:0

How to route local traffic to a local transparent proxy?

cn flag

I have an application to use multi-ports to send packages. I hope that traffic from some port(e.g.8080) shouldn't be intercepted while traffic from other ports should be redirected to a local proxy( listening on port 15001 ). My iptables commands are as follows:

iptables -t nat -N TEST_OUTPUT
iptables -t nat -A OUTPUT -p tcp -j TEST_OUTPUT

iptables -t nat -A TEST_OUTPUT -p tcp --sport 8080 -j RETURN
iptables -t nat -A TEST_OUTPUT -m owner ! --uid-owner proxy -j REDIRECT --to-port 15001

I plan to implement the local proxy with Go, but it seems that iptables NAT change the dport of the packet. How I know the dport of the original packet? Is there an alternative way?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.