Replies: 4 comments
-
I think you're referring to the discussion we had here? :) encode/httpx#1473 To be clear, right now the only thing that's public in HTTPCore is what is documented on the docs site. The internals of the connection pool or proxy implementations are private, and subject to change. Doesn't mean you can tweak them, but just be sure to pin HTTPCore strictly and expect to have to update them slightly as we fix bugs or tweak things internally. I don't think we're ready to make those internals public in full, however I'm personally happy to discuss specific issues and things we could expose selectively to make it easier to customize connections. |
Beta Was this translation helpful? Give feedback.
-
Yea, unfortunately I keep on hitting roadblocks as I progress further :(. Ultimately the authentication process and subsequent messages are tied directly with the connection which just isn't publicly exposed in httpx/httpcore. As you said at this point I'm effectively pinning the httpcore version to one where I know works. What I'm ultimately hoping to achieve is to expose the functionality I need as a public interface so I don't have to be so selective with my pinning at some point in the future. From what I've worked with I've found that making a custom transport solves a lot of my existing issues but there remains 2 problems:
I could potentially copy |
Beta Was this translation helpful? Give feedback.
-
@jborean93 From the specificity of your use case, and especially what seems to be "I need a long-lived special TLS connection that shouldn't close upon errors", are you sure you need our connection pooling behavior? Were you able to build a prototype that solely uses an The code for our HTTP/1.1 connection implementation isn't that big. It might be a very valid thing to do to duplicate it and tweak it to your liking. It may take some time to study and understand how it works specifically (reviewing the Edit: actually, since |
Beta Was this translation helpful? Give feedback.
-
I was with https://github.com/jborean93/pypsrp/blob/dfae26ed0fb6f6a27f8f7bc8ed121120bee75b3c/psrp/io/wsman.py#L40. Specially I create the connection and connect to the socket/TLS handshake with https://github.com/jborean93/pypsrp/blob/dfae26ed0fb6f6a27f8f7bc8ed121120bee75b3c/psrp/io/wsman.py#L211-L224. From there I check to see if it's still alive after a keep-alive expiry or whether the socket is readable (closed by server) and reconnect/reauth if needed.
That is true, I'm just hoping to avoid duplication of work as much as I can but it's probably the only sane thing that I can do without pinning to a specific version. Although as you said I need to copy more than just Heres to hoping I can still use proxies/socks in some way when using my own socket, sounds like that will require even more logic :( |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm wondering what the stability of the API is for httpcore. In particular I'm to initialize my own
*HTTPConnection
class in_async
and_sync
but I'm not sure whether the location of these classes, or even the structure, is expected to change in any future release. Can I safely use these classes with maybe a cap onhttpcore<1.0.0
in my requirements or would you not recommend this?I've got a very unique case where I need to tweak a transport for httpx and the
*ConnectionPool
classes just don't fit in my the way I need to connect, authenticate, and encrypt data for an endpoint. By being able to specify my own transport I can specify this behaviour myself but by using a "private" class likeAsyncHTTPConnection
I might be relying on unstable/private APIs that could change in a future release.Beta Was this translation helpful? Give feedback.
All reactions