sockets - How to listen to/forward all ports on an interface, in Python or otherwise -


i writing application, in python + twisted, serves first port of call dns requests – if requests meet patterns, e.g. namecoin .bit addresses or opennic tlds, passed different dns resolvers, otherwise default 1 used.

some addresses need redirected through special routes, e.g. tor .onion addresses don't resolve traditional ipv4 addresses, or websites require tunneling through vpn geolocation reasons. when dns requests such sites come in, want application create new loopback interface/alias , return ip of interface. need able tunnel tcp , udp traffic coming through interface through proxy/vpn or whatever endpoint set for.

the question is, how can this? listening on specific ports (e.g. 80) fine purposes, perfectionist know how accept connections/messages sent ports, without having set tens of thousands of listeners , potentially crashing system.

note: while in python, don't mind adding components in c++ or language, or playing around network configurations working.


Comments