4 ms·
> it binds to just ONE tcp port per a running instance ! How does that work? Do you need to run 65535 instances to cover all ports?
by yonatan8070 2y ago
> it binds to just ONE tcp port per a running instance !
How does that work? Do you need to run 65535 instances to cover all ports?
- Chilinot 2y agoYea, that statement confused me as well.
- geraldhh 2y agonat-redirection
- remram 2y agoiptables rule redirects all closed ports on the machine to the one portspoof listens to: https://github.com/drk1wi/portspoof/blob/c3f3c34531c59df229eafdaf69a818cc7a847ff3/system_files/iptables-config#L10 https://github.com/drk1wi/portspoof/blob/c3f3c34531c59df229e... Then it calls getsockopt to find out what the original port was: https://github.com/drk1wi/portspoof/blob/c3f3c34531c59df229eafdaf69a818cc7a847ff3/src/connection.cpp#L153 https://github.com/drk1wi/portspoof/blob/c3f3c34531c59df229e...
- Izmaki 2y agoThat's actually pretty darn neat. Thanks for the references, too.
- alanfranz 2y agowhy? A single process can bind to multiple ports. I don't know what's the hard limit actually, or how much memory it would use. Probably a port redirect would just be simpler.
- jagged-chisel 2y agoBut this thing says it binds to ONE port. iptables is doing the port redirect for unbound ports.