English
redirect
The redirect inbound: TCP connections that netfilter's redirect/dnat brought to it; the destination is SO_ORIGINAL_DST (IP6T_SO_ORIGINAL_DST for IPv6).
| Crate | ours-mod-redirect, modules/protocols/redirect |
| Binary feature | redirect |
| Crate features | none |
requires
Nothing.
provides
Provide::Inbound { key: "redirect" }— the options areListenOptions, as in sing-box.Provide::Schema { name: "inbounds.redirect" }.
Syntax: redirect.
Design
src/lib.rs: a listener on every shard (SO_REUSEPORT with several), socket hand-over on reload, as in tproxy; an accepted connection goes to the least loaded shard.
Limitations
detour and listening in a netns are rejected at build time.
Tests
tests/e2e/netns/tun.sh (the redirect part).