Skip to content

Conversation

@Multimo
Copy link

@Multimo Multimo commented Nov 24, 2025

issues

Hello, as per issue looking for ways to modify the transport layer of the httpclient that cloudfetch uses. Happy to go another way to solving this, this just seamed like the simplest. Thanks for your work on the driver, its been very useful 👍

@samikshya-db
Copy link
Collaborator

Thanks for making the clean fix, @Multimo !
In the long term we would ideally want to have a single httpClient throughout, with configurable options made available to the user. But as a short term fix, this looks good.

One minor comment on renaming.

connector.go Outdated
}

// WithCloudFetchHTTPClient allows a custom http client to be used for cloud fetch. Default is http.DefaultClient.
func WithCloudFetchHTTPClient(httpClient *http.Client) ConnOption {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we rename this to withHTTPClient ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, can you work with WithTransport option in this file for the private network use-case?

Copy link
Author

Choose a reason for hiding this comment

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

An alternative, until you merge the two http clients, could be to use have the WithTransport add to the CloudFetchConfig also. I can update to do this if you prefer.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes that would be great! thank you.

Copy link
Author

Choose a reason for hiding this comment

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

Hey @samikshya-db, thanks for getting back to me. I have swapped it so same the transport will be re-used between both http clients.Let me know if this is what you had in mind.

@Multimo Multimo force-pushed the multimo/allow-cloudfetch-client-configuration branch from 4929871 to 934d2b5 Compare December 9, 2025 14:46
httpClient := http.DefaultClient
if transport != nil {
httpClient = &http.Client{
Transport: transport,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this mean a new HttpClient is created on every fetch request when a custom transport is provided? If yes, can we make that more optimal?

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