-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support proxy #19
Comments
Not currently, but I could have a look. What kind of proxy? SOCKS? |
Http will be great, I'm using |
To send via proxy you can use sock arg. For example: from aiohttp_socks.proxy import create_proxy, ProxyType
proxy = create_proxy(
host=proxy["hostname"], port=proxy["port"], proxy_type=ProxyType.SOCKS5)
await proxy.connect(host, port)
await send(
message,
hostname=None,
port=None,
validate_certs=False, # for validate server_hostname should be passed to starttls.
username=source["username"],
password=source["password"],
start_tls=True,
sock=proxy.socket
) ` |
Any changes?
|
I was just going to add documentation for the sample above. aiohttp_socks doesn't say deprecated in the repo, but it hasn't been updated in a while. |
Oh yes I see. Does Socket I put as param to |
Can you give example of usage aiosmtplib with socks, please? |
@starfear the only example I have is the one above. The Using the SMTP client class directly (https://aiosmtplib.readthedocs.io/en/latest/client.html) should give you control over when the connection is opened/closed so you can sync it up with the proxy connect. |
Will this feature be added soon? Are there any alternatives to the above example? And can you provide some information for adding proxy support to the library yourself? |
Probably not unless someone is interested in contributing it. I'd accept a PR for documentation of how it works. |
Hi,
in our production environment, we need a proxy to send email, is there any plan to support it?
thanks,
The text was updated successfully, but these errors were encountered: