I added IPv6 support to simple_listener.py.
Although it was not by design, it turned out that simple_listener.py only works for IPv4. So I made some small changes to add IPv6 support.
When you use dictionary to define your listeners, use THP_TCP6 and THP_UDP6 to define TCP IPv6 and UDP IPv6 listeners respectively. The meaning of THP_TCP and THP_UDP has not changed, that’s for IPv4 listeners.
When you use port options to define your listeners, use prefix t6: and u6: to define TCP IPv6 and UDP IPv6 listeners respectively. The meaning of t: and u: has not changed, that’s for IPv4 listeners.
And by default, listening takes place on all IPv4 interfaces (0.0.0.0) when IPv4 listeners are defined, and listening takes place on all IPv6 interfaces (::) when IPv6 listeners are defined. That’s governed by option -a –address’ default value 0.0.0.0,::.
To explicitly specify an interface with option -a, you will need to provide an IPv4 address and an IPv6 address separated by a comma.
simple_listener_v0_1_5.zip (http)Click to Open Code Editor