I thought I had found a solution to this, however it's not working... My code for setting up the proxy was:
proxyc = aiohttp.ProxyConnector("http://proxy.server:3128")
client = discord.Client(connector=proxyc)
However, I get this very long error:
INFO:discord.client:on_ready has successfully been registered as an event
INFO:discord.client:on_message has successfully been registered as an event
INFO:discord.client:logging in using static token
INFO:discord.client:token auth returned status code 200
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/base_events.py", line 632, in create_connection
yield from self.sock_connect(sock, address)
File "/usr/lib/python3.5/asyncio/futures.py", line 358, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 290, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
raise self._exception
File "/usr/lib/python3.5/asyncio/selector_events.py", line 436, in _sock_connect_cb
raise OSError(err, 'Connect call failed %s' % (address,))
ConnectionRefusedError: [Errno 111] Connect call failed ('104.16.59.5', 443)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/wnp78/.local/lib/python3.5/site-packages/aiohttp/connector.py", line 581, in _create_connection
local_addr=self._local_addr)
File "/usr/lib/python3.5/asyncio/base_events.py", line 654, in create_connection
', '.join(str(exc) for exc in exceptions)))
OSError: Multiple exceptions: [Errno 111] Connect call failed ('104.16.58.5', 443), [Errno 111] Connect call failed ('104.16.59.5', 443)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/wnp78/.local/lib/python3.5/site-packages/aiohttp/connector.py", line 310, in connect
transport, proto = yield from self._create_connection(req)
File "/home/wnp78/.local/lib/python3.5/site-packages/aiohttp/connector.py", line 604, in _create_connection
(req.host, req.port, exc.strerror)) from exc
aiohttp.errors.ClientOSError: [Errno None] Can not connect to discordapp.com:443 [None]
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "banh.py", line 35, in <module>
client.run('MTkxMTA1NTI4NjY2MTI4Mzg0.Cj1caw.z2uI9jNKBWx-WXw0I_IeQPuqCFU')
File "/home/wnp78/.local/lib/python3.5/site-packages/discord/client.py", line 496, in run
self.loop.run_until_complete(self.start(*args, **kwargs))
File "/usr/lib/python3.5/asyncio/base_events.py", line 337, in run_until_complete
return future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
raise self._exception
File "/usr/lib/python3.5/asyncio/tasks.py", line 241, in _step
result = coro.throw(exc)
File "/home/wnp78/.local/lib/python3.5/site-packages/discord/client.py", line 468, in start
yield from self.connect()
File "/home/wnp78/.local/lib/python3.5/site-packages/discord/client.py", line 421, in connect
self.ws = yield from DiscordWebSocket.from_client(self)
File "/home/wnp78/.local/lib/python3.5/site-packages/discord/gateway.py", line 193, in from_client
gateway = yield from get_gateway(client.token, loop=client.loop)
File "/home/wnp78/.local/lib/python3.5/site-packages/discord/gateway.py", line 123, in get_gateway
resp = yield from session.get(endpoints.GATEWAY, headers=headers)
File "/home/wnp78/.local/lib/python3.5/site-packages/aiohttp/client.py", line 529, in __iter__
resp = yield from self._coro
File "/home/wnp78/.local/lib/python3.5/site-packages/aiohttp/client.py", line 183, in _request
conn = yield from self._connector.connect(req)
File "/home/wnp78/.local/lib/python3.5/site-packages/aiohttp/connector.py", line 320, in connect
.format(key, exc.strerror)) from exc
aiohttp.errors.ClientOSError: [Errno None] Cannot connect to host discordapp.com:443 ssl:True [Can not connect to discordapp.com:443 [None]]
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f40bd09ce80>
Any help would be appreciated