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

proxy from env support? #25

Closed
saks opened this issue Feb 5, 2020 · 2 comments
Closed

proxy from env support? #25

saks opened this issue Feb 5, 2020 · 2 comments

Comments

@saks
Copy link
Contributor

saks commented Feb 5, 2020

Hi!
We found that simple_segment fails to connect to Segment API if HTTPS_PROXY env var is provided. It looks like the issue lies in the use of Net::HTTP.start method which accepts explicit proxy settings but does not favour env vars.

We've tried rewriting SimpleSegment::Request#post without method start and it seems works fine.

@whatthewhat
Copy link
Owner

Hey @saks!
I don't personally use proxies on the projects that use this gem, but looking at the docs it seems like Net::HTTP.start should be using the env variable as well 🤔

I'm not opposed to switching from Net::HTTP.start to something else, as long as there's no breaking change to http_options if you want to submit a PR.

btw, what ruby version are you running?

@saks
Copy link
Contributor Author

saks commented Feb 6, 2020

Hey! Thanks for looking into it. You're right, it's a little change that was necessary to make Net::HTTP.start consider proxy settings from env vars.
We use 2.4.9, going to upgrade soon, but I don't expect any difference in the behaviour.

I've prepared a little PR to address it, please have a look.

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

No branches or pull requests

2 participants