Skip to content

chore: Add HttpClient Type#12

Merged
Takaros999 merged 2 commits into
mainfrom
takis/add-http-client-type
Sep 8, 2025
Merged

chore: Add HttpClient Type#12
Takaros999 merged 2 commits into
mainfrom
takis/add-http-client-type

Conversation

@Takaros999
Copy link
Copy Markdown
Contributor

Added a type for the http client, previously it was improssible to use it because it was relying in a private VSockClientBuilder type.

andy-t-wang
andy-t-wang previously approved these changes Sep 8, 2025
Comment thread src/http.rs
pub const VSOCK_PROXY_CID: u32 = 3;

/// A HTTP client that tunnels all requests through the host's vsock proxy.
pub type HttpClient = Client<HttpsConnector<VSockClientBuilder>>;
Copy link
Copy Markdown
Contributor

@andy-t-wang andy-t-wang Sep 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might not work when you import in a project since VSockClientBuilder is private in utils.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth double checking

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated. It didn't cause compile issues, but it's an anti-pattern "private in public API" so I ended up re-exporting the type here.

Comment thread src/http.rs
pub const VSOCK_PROXY_CID: u32 = 3;

/// A HTTP client that tunnels all requests through the host's vsock proxy.
pub type HttpClient = Client<HttpsConnector<VSockClientBuilder>>;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth double checking

@Takaros999 Takaros999 merged commit f7d1c6b into main Sep 8, 2025
9 checks passed
@Takaros999 Takaros999 deleted the takis/add-http-client-type branch September 8, 2025 14:19
@github-actions github-actions Bot mentioned this pull request Sep 8, 2025
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.

2 participants