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

feat: Add support for proxy config #229

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

zwells
Copy link

@zwells zwells commented Nov 4, 2024

Description

Added proxy_url to shorebird.yaml to use with reqwest client in network.rs (if defined)

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

Added proxy_url to shorebird.yaml to use with reqwest if specified
Ok(client)
}

fn read_config() -> anyhow::Result<YamlConfig> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, looks like the request callbacks would now need to be config-specifc. 🤔

@eseidel
Copy link
Contributor

eseidel commented Nov 5, 2024

I'm open to this change. The use case of "we want to use Shorebird behind a corporate network" makes sense.

It is unfortunate that we can't (easily) fix this by using whatever existing network interface was already correctly configured. It feels wrong to have to configure Shorebird's https client specifically.

I think the only thing blocking this landing is one of us fiddling with how to plumb the shorebird.yaml reading through to where it's normally done (and also probably change how the network callbacks are created).

@zwells
Copy link
Author

zwells commented Nov 11, 2024

Removed the proposed yaml config var in favor of reqwest pulling the system proxy for us.

@eseidel
Copy link
Contributor

eseidel commented Nov 14, 2024

If this change works, it makes a lot of sense and would be easy for us to land. Thoughts @bryanoltman?

@eseidel eseidel requested a review from bryanoltman November 14, 2024 18:44
@eseidel
Copy link
Contributor

eseidel commented Nov 14, 2024

My guess is this won't work, unless reqwest has iOS or Android specific code to read the proxy config (which I doubt it has).

We also presumably would have to add the "socks" option to our reqwest import:
seanmonstar/reqwest#790

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