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

Adds proxy argument for routing HttpLogger through a proxy #206

Closed
wants to merge 1 commit into from

Conversation

zephinzer
Copy link

@zephinzer zephinzer commented Apr 15, 2018

Fixes #205

…a proxy

- [package.json] added http/s proxy agents to dependencies
- [package.json] added proxy middleware for express to test proxy behaviour
- [HttpLogger.js] added proxy parameter in constructor
- [HttpLogger.js] added createProxyAgentIfAvailable() instance method
- [HttpLogger.js] added agent property to accept proxy agent
- [integrationTest.js] replicated existing tests using a simulated proxy server
- using http-proxy-middleware instead of express-http-proxy for tests because of conflict with restify
- fixed eslint issue
@codefromthecrypt codefromthecrypt changed the title [#205] adds proxy argument for routing HttpLogger through a proxy Adds proxy argument for routing HttpLogger through a proxy Apr 16, 2018
@@ -13,12 +13,15 @@
"license": "Apache-2.0",
"repository": "https://github.com/openzipkin/zipkin-js",
"dependencies": {
"http-proxy-agent": "^2.1.0",
Copy link
Member

Choose a reason for hiding this comment

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

what's the risk of having these dependencies?

@zephinzer
Copy link
Author

zephinzer commented Apr 16, 2018 via email

@codefromthecrypt
Copy link
Member

codefromthecrypt commented Apr 16, 2018 via email

@zephinzer
Copy link
Author

zephinzer commented Apr 17, 2018

@adriancole i see, the http-proxy-agent and https-proxy-agent together adds 7 dependencies including itself. the five dependencies are debug, ms, agent-base, es6-promise and es6-promisify which are widely used libraries, i don't assess it is likely there will be such conflicts caused by irregular release cycles/improper versioning. also, the proxy is only invoked upon passing of the argument so it will not break existing implementations

@codefromthecrypt
Copy link
Member

do you anticipate this would break those using react or browser functionality? cc @DanielMSchmidt @micaelsampaio

@zephinzer
Copy link
Author

@adriancole i suspect it might, didn't consider that- are there any known open source projects using browser functionality so i can quickly replicate it to test?

@jcchavezs
Copy link
Contributor

@zephinzer could you proceed with the test you mention?

@codefromthecrypt
Copy link
Member

lacking an automatic browser test, it would in my opinion suffice if you manually test by locally publishing this, editing the zipkin-js-example to use a proxy, and testing it

https://github.com/openzipkin/zipkin-js-example

I don't actually know of an automatic browserify test, and how to stitch it into circleci... maybe @eirslett does perhaps, but seems a separate issue to create that infra cc @openzipkin/devops-tooling

@jcchavezs
Copy link
Contributor

jcchavezs commented Jul 21, 2019

Any chance instead we add the dependencies, we just add an interface for proxy and allow users to inject it? @zephinzer

@codefromthecrypt
Copy link
Member

decoration somehow sounds good.

strategically: bear in mind we probably will want to redo the http logger internals soon, so that the "sender" concept is extracted. This will reduce the code about http to very small and makes proxy or alternate impls easy.

@jcchavezs
Copy link
Contributor

This is fixed in #439 hence I am closing this issue. Thanks @zephinzer anyways for the effort!

@jcchavezs jcchavezs closed this Mar 29, 2020
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.

Support zipkin server behind a proxy in HttpLogger
3 participants