Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Support for HTTP proxies #363

Open
mfpierre opened this issue Aug 29, 2017 · 11 comments
Open

Support for HTTP proxies #363

mfpierre opened this issue Aug 29, 2017 · 11 comments

Comments

@mfpierre
Copy link

Do you want to request a feature or report a bug?

feature

What is the current behavior?

When the node app has to go through a proxy to have HTTP access, raven-node can't access sentry to report anything.
With current implementation, it seems there's currently no way to configure a http proxy for the library.

What is the expected behavior?

There seems to be at least two options to have the library work behind a http proxy:

  1. Tweak the current http transport to support http proxies by adding some options (path part should include the full url and the host header set to the host you want to connect to (see here))
  2. Use the request library for http transport that has native support for HTTP_PROXY/HTTPS_PROXY/NO_PROXY variables
@ndmanvar
Copy link

In progress PR: #370

Works with http endpoint, still getting it working on https endpoint (using TLS).

@tom2strobl
Copy link

Awesome to see this is something being worked on as we're very much in need of it. Do you have some sort of ETA for the pull request to be merged? And will it automatically infer the proxy from env vars like other libraries do or do we have to set it explicitly? If the latter, regarding the implementation in your PR, how do we specify a user+password for the proxy?

@tom2strobl
Copy link

@ndmanvar I know it's kinda rude and I'm sorry but is there any chance you could give us an ETA for this? Otherwise we'd have to abandon the usage of sentry for the particular project which we absolutely don't want to.

@ndmanvar
Copy link

Hi @tom2strobl . All good, I understand.

Have you seen https://gist.github.com/ndmanvar/7ae7b4db7bf1cda30545c1480fde77fe (workaround / client-side solution)?
It uses the request libraray within a custom transport. A client-side custom transport is probably the easiest / quickest way to get up and running.
I believe you can pass user+password in the above example like this:

$ HTTP_PROXY=http://USER:PASSWORD@PROXY_HOST:PROXY_PORT node customtransport_test.js

@tom2strobl
Copy link

@ndmanvar For some reason I never picked up that gist. That indeed worked like a charm – thanks a bunch!

@ndmanvar
Copy link

@tom2strobl no problem. glad to hear it worked out-of-box! 😄

Closing this issue as the gist (client-side transport using request library) is the best solution (at the moment).

@mfpierre
Copy link
Author

@ndmanvar I don't get why you're closing this issue as the gist is obviously a quick fix and will end up being a pain to maintain for users who wants to keep the library up to date.

IMHO the support for HTTP proxies should be out of the box.

@ndmanvar ndmanvar reopened this Oct 27, 2017
@ndmanvar
Copy link

@mfpierre We believe this should (and will be) part of raven-node. Was just closing as not working at the moment (Closing this does not mean that we are not getting this in). Will continue to work on this in the new few weeks and keep updating here (:

I just figured out how npm library is handling proxying, need to bring some of that logic into here.

Let me know if you have any questions.
Sorry for the confusion. I have re-opened and will keep this open.

@ndmanvar
Copy link

ndmanvar commented Nov 17, 2017

#397

Works for both HTTP and HTTPS endpoint.

@jazmon
Copy link

jazmon commented Jan 4, 2018

Hi! What's the status of this issue?

@ndmanvar
Copy link

ndmanvar commented Jan 5, 2018

Hi @jazmon !

On it. Hope to be done by mid next week latest.

Status:

  • Added proxy authentication (user and password)

TODO / In progress:

  • Add tests

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants