You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Locally I am using a tiny 2 line patch to quic/sync.py which just changes the direct use of socket.socket to be use of socket_factory instead, just like in dns.query. I can then override socket_factory in my own code for proxyfication.
Describe the solution you'd like.
I would like to be able to override the socket used to easily use a proxy server with dnspython. The solution above works great for sync but something else/more is needed for the async cases. I haven't played around with async at all while testing this.
I can open a PR with the patch for _sync.py but I wanted to gauge the interest first.
Thanks!
The text was updated successfully, but these errors were encountered:
I'd be ok with adding a socket_factory to quic/_sync.py; I think it has to be there (rather than reusing query's socket_factory) for circularity reasons. I don't think you have to worry about async as it already abstracts socket creation with the make_socket() backend method, so if someone needed to change it they could subclass the backend.
Motivation
dns.query allows me to override the socket creation function for
tcp
,udp
,doh
by overridingsocket_factory
here:dnspython/dns/query.py
Line 177 in a977e61
This works great!
But the quic code uses
socket.socket
directly:dnspython/dns/quic/_sync.py
Line 78 in a977e61
Locally I am using a tiny 2 line patch to
quic/sync.py
which just changes the direct use ofsocket.socket
to be use ofsocket_factory
instead, just like indns.query
. I can then overridesocket_factory
in my own code for proxyfication.Describe the solution you'd like.
I would like to be able to override the socket used to easily use a proxy server with dnspython. The solution above works great for sync but something else/more is needed for the async cases. I haven't played around with async at all while testing this.
I can open a PR with the patch for
_sync.py
but I wanted to gauge the interest first.Thanks!
The text was updated successfully, but these errors were encountered: