<s> import socket <EOL> import socks <EOL> SERVER_IP = '<STR_LIT:127.0.0.1>' <EOL> SERVER_PORT = <NUM_LIT> <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> sock_out = socks . socksocket ( socket . AF_INET , socket . SOCK_DGRAM , <EOL> socket . SOL_UDP ) <EOL> sock_out . set_proxy ( socks . SOCKS5 , SERVER_IP , SERVER_PORT ) <EOL> sock_out . bind ( ( '<STR_LIT:127.0.0.1>' , <NUM_LIT> ) ) <EOL> sock_in1 = socket . socket ( socket . AF_INET , socket . SOCK_DGRAM , <EOL> socket . SOL_UDP ) <EOL> sock_in2 = socket . socket ( socket . AF_INET , socket . SOCK_DGRAM , <EOL> socket . SOL_UDP ) <EOL> sock_in1 . bind ( ( '<STR_LIT:127.0.0.1>' , <NUM_LIT> ) ) <EOL> sock_in2 . bind ( ( '<STR_LIT:127.0.0.1>' , <NUM_LIT> ) ) <EOL> sock_out . sendto ( b'<STR_LIT:data>' , ( '<STR_LIT:127.0.0.1>' , <NUM_LIT> ) ) <EOL> result1 = sock_in1 . recvfrom ( <NUM_LIT:8> ) <EOL> sock_out . sendto ( b'<STR_LIT:data>' , ( '<STR_LIT:127.0.0.1>' , <NUM_LIT> ) ) <EOL> result2 = sock_in2 . recvfrom ( <NUM_LIT:8> ) <EOL> sock_out . close ( ) <EOL> sock_in1 . close ( ) <EOL> sock_in2 . close ( ) <EOL> assert result1 == result2 <EOL> sock_out = socks . socksocket ( socket . AF_INET , socket . SOCK_DGRAM , <EOL> socket . SOL_UDP ) <EOL> sock_out . set_proxy ( socks . SOCKS5 , SERVER_IP , SERVER_PORT ) <EOL> sock_out . bind ( ( '<STR_LIT:127.0.0.1>' , <NUM_LIT> ) ) <EOL> sock_in1 = socket . socket ( socket . AF_INET6 , socket . SOCK_DGRAM , <EOL> socket . SOL_UDP ) <EOL> sock_in2 = socket . socket ( socket . AF_INET6 , socket . SOCK_DGRAM , <EOL> socket . SOL_UDP ) <EOL> sock_in1 . bind ( ( '<STR_LIT>' , <NUM_LIT> ) ) <EOL> sock_in2 . bind ( ( '<STR_LIT>' , <NUM_LIT> ) ) <EOL> sock_out . sendto ( b'<STR_LIT:data>' , ( '<STR_LIT>' , <NUM_LIT> ) ) <EOL> result1 = sock_in1 . recvfrom ( <NUM_LIT:8> ) <EOL> sock_out . sendto ( b'<STR_LIT:data>' , ( '<STR_LIT>' , <NUM_LIT> ) ) <EOL> result2 = sock_in2 . recvfrom ( <NUM_LIT:8> ) <EOL> sock_out . close ( ) <EOL> sock_in1 . close ( ) <EOL> sock_in2 . close ( ) <EOL> assert result1 == result2 <EOL> sock_out = socks . socksocket ( socket . AF_INET , socket . SOCK_DGRAM , <EOL> socket . SOL_UDP ) <EOL> sock_out . set_proxy ( socks . SOCKS5 , SERVER_IP , SERVER_PORT ) <EOL> sock_out . bind ( ( '<STR_LIT:127.0.0.1>' , <NUM_LIT> ) ) <EOL> sock_in1 = socket . socket ( socket . AF_INET6 , socket . SOCK_DGRAM , <EOL> socket . SOL_UDP ) <EOL> sock_in1 . bind ( ( '<STR_LIT>' , <NUM_LIT> ) ) <EOL> sock_out . sendto ( b'<STR_LIT:data>' , ( '<STR_LIT>' , <NUM_LIT> ) ) <EOL> result3 = sock_in1 . recvfrom ( <NUM_LIT:8> ) <EOL> assert result1 != result3 <EOL> sock_out . close ( ) <EOL> sock_in1 . close ( ) </s>
