ApplicationInsights-node.js
ApplicationInsights-node.js copied to clipboard
No events in the dashboard when using proxy, 'Document Moved' messages in the log
I am having trouble using the SDK behind a proxy (in a docker container).
If using a proxy url like http://proxyfqdn:3128
in appInsights.defaultClient.config.proxyHttpUrl
and appInsights.defaultClient.config.proxyHttpsUrl
I am receiving the following log entries (after activating internal logging):
ApplicationInsights:CorrelationIdManager [ { method: 'GET', disableAppInsightsAutoCollection: true } ]
ApplicationInsights:Sender [ { method: 'POST',
withCredentials: false,
headers:
{ 'Content-Type': 'application/x-json-stream',
'Content-Encoding': 'gzip',
'Content-Length': 635 } } ]
ApplicationInsights:Sender [ '<head><title>Document Moved</title></head>\n<body><h1>Object Moved</h1>This document may be found <a HREF="https://dc.services.visualstudio.com/v2/track">here</a></body>' ]
As I understand it, there was once a change from http to https (see https://github.com/Microsoft/ApplicationInsights-node.js/issues/196#issuecomment-284798465), but even explicitly setting
appInsights.defaultClient.config.endpointUrl = "https://dc.services.visualstudio.com/v2/track";
makes no difference.
I would appreciate any advice how to solve this. I have to use a proxy and can't use http(s)_proxy environment variables because of other libraries breaking for internal calls (since they don't support no_proxy).
@petersendev Does your proxy support https requests in general? What happens if you try a test request using your proxy to a server that only responds on HTTPS, such as https://tls-v1-2.badssl.com:1012/
From a first glance, it seems that the actual protocol (http vs https) is getting lost, either between this SDK and your proxy, or your proxy and the outer internet.
HTTPS traffic works fine, albeit not via custom port.