Skip to content

XHR proxy does not support environment HTTP proxy settings #586

Description

@denandz

Running the simulator and forwarding traffic through an intercepting HTTP proxy such as fiddler, owasp zap, burp, glorp or so forth, is currently not possible.

This is due to the xhr proxy using the http and https request libraries, which require additional configuration to read proxy configurations from HTTP_PROXY environment variables and so forth.

var http = require('http'),
https = require('https'),

if (requestURL.protocol === 'https:') {
proxyRequest = https.request(options, proxyCallback);
} else {
proxyRequest = http.request(options, proxyCallback);
}

Running with HTTP_PROXY=http://127.0.0.1:8080 HTTPS_PROXY=http://127.0.0.1:8080 NODE_TLS_REJECT_UNAUTHORIZED=0 simulate android or similar does not result in XHR calls being sent to the proxy.

The current state:

┌─────────────────────────────┐               ┌─────────┐           ┌───┐
│  Browser simulating Cordova ┼──────────────►│xhr_proxy┼──────────►│API│
└─────────────────────────────┘               └─────────┘           └───┘

What needs be implemented:

┌──────────────────────────┐          ┌─────────┐       ┌──────────┐      ┌───┐
│Browser simulating Cordova┼─────────►│xhr_proxy┼──────►│HTTP_PROXY┼─────►│API│
└──────────────────────────┘          └─────────┘       └──────────┘      └───┘

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions