title: Proxying UDP over SOCKS5 proxy in Python
body: <p>Is it possible to send UDP datagrams over SOCKS5 proxy in Python using any SOCKS client lib? SocksiPy does not seem to work or maybe I am just using it wrong. The following code does not work, it tries to connect to the destination directly:</p>
  
  <pre><code>s = socks.socksocket ( socket.AF_INET, socket.SOCK_DGRAM )
  s.setproxy(socks.PROXY_TYPE_SOCKS5,"socks.proxy.lan")
  s.sendto ( payload, ( ip, port ) )
  </code></pre>
  
  <p>If I change <code>SOCK_DGRAM</code> to <code>SOCK_STREAM</code> the code does not work either, it does not try to connect anywhere then.</p>