Skip to content
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

Add server ip address to response object #328

Merged
merged 3 commits into from
Jun 26, 2024

Conversation

embeddinglayer
Copy link

@embeddinglayer embeddinglayer commented Jun 18, 2024

Ideally the response object should include the established server ip. Curl already offers that which is a better alternative to opening an entirely new socket connection to resolve that data.

import curl_cffi.requests as requests

resp = requests.get("https://example.com")
print(resp.ip)

@embeddinglayer
Copy link
Author

Ideally the response object contains more data for the underlying connection such as CURLINFO_CERTINFO and CURLINFO_TLS_SESSION

@iffybug
Copy link
Collaborator

iffybug commented Jun 19, 2024

Interesting idea! However, it seems that there is no such const as CURLINFO_NUM_CERTS.

@embeddinglayer
Copy link
Author

embeddinglayer commented Jun 19, 2024

Interesting idea! However, it seems that there is no such const as CURLINFO_NUM_CERTS.

Yeah, that code was unintentional looks like vs-code hadn't persisted to disk when I committed. Just removed it, I'll push the full code for certs in a later commit.

Remove invalid code
@iffybug
Copy link
Collaborator

iffybug commented Jun 20, 2024

We need one or two unittests to make sure that this patch works as expected. Feel free to add them now or leave it there and I will add them later.

@iffybug iffybug changed the base branch from main to develop June 26, 2024 03:30
@iffybug iffybug merged commit fd581e1 into lexiforest:develop Jun 26, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants