I have the following node proxy server set up to strip out the page name from a request made from one web app and use it to display page info in a second web app. It works fine but for every request intercepted a new browser is opened up. Is there anyway to detect if an internet explorer browser is aleady open so i can use that?
var http = require('http'),
httpProxy = require('http-proxy'),
request = require('request'),
open = require('open');
//
// Create proxy server
//
httpProxy.createProxyServer({target:'http://localhost:9000'}).listen(9085);
//
// Create target server
//
http.createServer(function (req, res) {
if (req.method=='GET') {
if (req.url.indexOf("Page.do") > -1) {
var temp = req.url.split("Page.do")[0].split("/");
var pageName = temp[temp.length - 1];
var docURL = "http://localhost:9081/mysecondwebapp/pages/" + pageName + ".html";
open(docURL, "iexplore");
};
};
}).listen(9000);