VirusTotal / vt-py

The official Python 3 client library for VirusTotal
https://virustotal.github.io/vt-py/
Apache License 2.0
531 stars 121 forks source link

vt-py and socks5 proxy #171

Closed f1in closed 9 months ago

f1in commented 9 months ago

I want to use vt-py with socks5 proxy, but seems like aiohttp (which vt-py relies on) allows HTTP proxy only. At the same time, there are a couple of libraries adding this feature to aiohttp, for example aiohttp-socks by passing your own custom connector object to aiohttp:

connector = ProxyConnector.from_url('socks5://user:password@127.0.0.1:1080')

async with aiohttp.ClientSession(connector=connector) as session:
    async with session.get(url) as response:
        return await response.text()

It would be super nice if you guys can add an optional argument in the Client so we can pass a custom connector to aiohttp's ClientSession.

mgmacias95 commented 9 months ago

Hello @f1in,

I have made an implementation of this on #173, can you check if it fits your needs? Thanks!

f1in commented 9 months ago

We just run a couple of tests and it works perfectly, exactly what we were looking for. Thank you very much for your help!

mgmacias95 commented 9 months ago

Yay! I'm closing this issue then. Don't hesitate to open a new one if you need help!