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│
└──────────────────────────┘ └─────────┘ └──────────┘ └───┘
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
httpandhttpsrequest libraries, which require additional configuration to read proxy configurations fromHTTP_PROXYenvironment variables and so forth.cordova-simulate/src/server/xhr-proxy.js
Lines 3 to 4 in 5ab7baf
cordova-simulate/src/server/xhr-proxy.js
Lines 30 to 34 in 5ab7baf
Running with
HTTP_PROXY=http://127.0.0.1:8080 HTTPS_PROXY=http://127.0.0.1:8080 NODE_TLS_REJECT_UNAUTHORIZED=0 simulate androidor similar does not result in XHR calls being sent to the proxy.The current state:
What needs be implemented: