exceptionless / Exceptionless.JavaScript

Exceptionless JavaScript client
http://exceptionless.com
Apache License 2.0
59 stars 24 forks source link

Does Exceptionless use proxy settings? #68

Closed imran-uk closed 1 year ago

imran-uk commented 7 years ago

I'm having a problem getting my log and error messages through to the server from my local machine.

I have a simple test script that is sending a sample error message.

I have enabled debugging and I can see it is trying to submit to https://collector.exceptionless.io

However I get an error response like this:

[info] Exceptionless: Enqueuing event: 1488805279857 type=error
[info] Exceptionless: Processing queue...
[info] Exceptionless: Sending 1 events to https://collector.exceptionless.io.
[info] Exceptionless: Updating settings from v0 to vNaN
[info] Exceptionless: Checking for updated settings from: v0.
[error] Exceptionless: Error submitting events: Unauthorized
[info] Exceptionless: Suspending processing for 5 minutes.
[info] Exceptionless: Updating settings timer with delay: undefined
[info] Exceptionless: Finished processing queue.
[error] Exceptionless: Unable to parse settings: '<!DOCTYPE html public "-//W3C//DTD HTM

Where the HTML response is from my employers proxy.

I have tried setting the proxy using environment variables (eg. HTTP_PROXY, https_proxy) and via npm config set ... but it makes no difference.

How can I enable Exceptionless to use a proxy or am I doing something fundamentally wrong? I have a valid API key set and have followed the example pretty accurately.

My test script looks like this:

var exceptionlessClient = require('exceptionless').ExceptionlessClient.default;

exceptionlessClient.config.apiKey = '<API key>';
exceptionlessClient.config.useDebugLogger();

var err = new Error('oh shi');

exceptionlessClient.submitException(err);
niemyjski commented 7 years ago

Sorry for just getting back to you, I just saw this sitting in my GitHub notifications (I've been traveling last week and didn't see it).

You'll get unauthorized if the api key is invalid (mistyped or revoked server side). Can you ensure the api key is being set to the right value as shown in your project settings. Can you set .useDebugLogger() before you set the api key, is it passing this api key along with the request as a header?

niemyjski commented 7 years ago

Were you able to get this working?

niemyjski commented 1 year ago

Were you able to get this working with node global proxy? https://stackoverflow.com/questions/18586902/node-js-global-proxy-setting