-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Setting client TCP socket options before connection #10520
Labels
Milestone
Comments
I think it makes sense to use the same pattern here. |
5 tasks
TimMenninger
added a commit
to TimMenninger/aiohttp
that referenced
this issue
Mar 10, 2025
Instead of TCPConnector taking a list of sockopts to be applied sockets created, take a socket_factory callback that allows the caller to implement socket creation entirely.
TimMenninger
added a commit
to TimMenninger/aiohttp
that referenced
this issue
Mar 10, 2025
Instead of TCPConnector taking a list of sockopts to be applied sockets created, take a socket_factory callback that allows the caller to implement socket creation entirely.
5 tasks
TimMenninger
added a commit
to TimMenninger/aiohttp
that referenced
this issue
Mar 10, 2025
Instead of TCPConnector taking a list of sockopts to be applied sockets created, take a socket_factory callback that allows the caller to implement socket creation entirely.
TimMenninger
added a commit
to TimMenninger/aiohttp
that referenced
this issue
Mar 10, 2025
Instead of TCPConnector taking a list of sockopts to be applied sockets created, take a socket_factory callback that allows the caller to implement socket creation entirely.
TimMenninger
added a commit
to TimMenninger/aiohttp
that referenced
this issue
Mar 10, 2025
Instead of TCPConnector taking a list of sockopts to be applied sockets created, take a socket_factory callback that allows the caller to implement socket creation entirely.
TimMenninger
added a commit
to TimMenninger/aiohttp
that referenced
this issue
Mar 10, 2025
Instead of TCPConnector taking a list of sockopts to be applied sockets created, take a socket_factory callback that allows the caller to implement socket creation entirely.
TimMenninger
added a commit
to TimMenninger/aiohttp
that referenced
this issue
Mar 10, 2025
Instead of TCPConnector taking a list of sockopts to be applied sockets created, take a socket_factory callback that allows the caller to implement socket creation entirely.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem?
I would like to have socket options applied before a connection is made so that they apply to handshake packets (e.g. IP_TOS, IPv6_TCLASS ).
Describe the solution you'd like
aiohappyeyeballs v2.5.0 now receives a "socket_factory" parameter (callback that returns a new socket) that allows a user to perform their own socket creation before each connection.
aio-libs/aiohappyeyeballs@v2.4.8...v2.5.0
I would like TCPConnector's constructor to offer a similar optional parameter so this functionality can be used. I propose that a "socket_factory" parameter replaces the recent "tcp_sockopts" parameter.
Describe alternatives you've considered
The existing tcp_sockopts could be repurposed for this, however, passing in socket options like this doesn't allow one to set different options depending on the destination address (e.g., IPv4 vs IPv6).
Related component
Client
Additional context
I worked the related PR for aiohappyeyeballs and am happy to offer a PR for this change too.
Code of Conduct
The text was updated successfully, but these errors were encountered: