'Set which proxy LibTorrent should use (default = 0).
:param proxy_type: int (0 = no proxy server,
1 = SOCKS4,
2 = SOCKS5,
3 = SOCKS5 + auth,
4 = HTTP,
5 = HTTP + auth)
:param server: (host, port) tuple or None
:param auth: (username, password) tuple or None'

def set_libtorrent_proxy_settings(self, proxy_type, server=None, auth=None):

    self.config['libtorrent']['proxy_type'] = proxy_type
    self.config['libtorrent']['proxy_server'] = (server if proxy_type else None)
    self.config['libtorrent']['proxy_auth'] = (auth if (proxy_type in [3, 5]) else None)
