0

I'd rather not change the global proxy settings as not just my app but a pile of others are running on the Windows Server (2K8 R2) and these others would be adversely affected by a global change.

Is it possible to set an application-level proxy in a Windows environment? I understand such things are possible in Linux and Mac.

ALSO

What is actually happening when one uses a free proxy server? How is the traffic managed and could I set up a app-level proxy myself?

bugmagnet
  • 7,631
  • 8
  • 69
  • 131

1 Answers1

0
// HttpRequest SetCredentials flags.
HTTPREQUEST_PROXYSETTING_DEFAULT   = 0;
HTTPREQUEST_PROXYSETTING_PRECONFIG = 0;
HTTPREQUEST_PROXYSETTING_DIRECT    = 1;
HTTPREQUEST_PROXYSETTING_PROXY     = 2;

function HTTPGETPROXIED(oHTTP, url, proxyurl) {
  var status, respsonse;
  try {
    var o = oHTTP.open("GET", url, false);
    oHTTP.SetTimeouts( 0, 12000, 6000, 6000 ); // 2/10 the usual
    if (proxyurl) {
        oHTTP.SetProxy( HTTPREQUEST_PROXYSETTING_PROXY, proxyurl);
    } else {
        oHTTP.SetProxy( HTTPREQUEST_PROXYSETTING_DIRECT, "" );
    }
    var s = oHTTP.send();
    status = oHTTP.Status;
    response = oHTTP.ResponseText;
  }
  catch (err) {
    status = -1;
    response = err.message.replace(/\r\n|\n/g,"") + ": " + proxyurl;
  }
  return [status, response];
}

Based on code on MSDN

bugmagnet
  • 7,631
  • 8
  • 69
  • 131