function applyNoProxyOption(transportUrlSegments, proxy) {
    var no_proxy = process.env.no_proxy;
    var urlIsExemptFromProxy = no_proxy &&
        no_proxy
            .split(',')
            .some(function (exemption) { return transportUrlSegments.host.endsWith(exemption) || transportUrlSegments.hostname.endsWith(exemption); });
    if (urlIsExemptFromProxy) {
        return undefined;
    }
    else {
        return proxy;
    }
}
Honors the `no_proxy` env variable with the highest priority to allow for hosts exclusion.

@param transportUrl The URL the transport intends to send events to.
@param proxy The client configured proxy.
@returns A proxy the transport should use.