How to use the tunnel.httpOverHttps function in tunnel

To help you get started, we’ve selected a few tunnel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-sdk-for-js / sdk / core / core-http / lib / axiosHttpClient.ts View on Github external
export function createTunnel(isRequestHttps: boolean, isProxyHttps: boolean, tunnelOptions: tunnel.HttpsOverHttpsOptions): http.Agent | https.Agent {
  if (isRequestHttps && isProxyHttps) {
    return tunnel.httpsOverHttps(tunnelOptions);
  } else if (isRequestHttps && !isProxyHttps) {
    return tunnel.httpsOverHttp(tunnelOptions);
  } else if (!isRequestHttps && isProxyHttps) {
    return tunnel.httpOverHttps(tunnelOptions);
  } else {
    return tunnel.httpOverHttp(tunnelOptions);
  }
}
github DIYgod / RSSHub / lib / utils / request-wrapper.js View on Github external
process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0;
            agent.http = tunnel.httpOverHttp({
                proxy: {
                    host: config.proxy.host,
                    port: parseInt(config.proxy.port),
                },
            });
            agent.https = tunnel.httpsOverHttp({
                proxy: {
                    host: config.proxy.host,
                    port: parseInt(config.proxy.port),
                },
            });
            break;
        case 'https':
            agent.http = tunnel.httpOverHttps({
                proxy: {
                    host: config.proxy.host,
                    port: parseInt(config.proxy.port),
                },
            });
            agent.https = tunnel.httpsOverHttps({
                proxy: {
                    host: config.proxy.host,
                    port: parseInt(config.proxy.port),
                },
            });
            break;
    }
}

const requestWrapper = (url, options) => {
github Azure / azure-sdk-for-js / sdk / core / core-http / lib / proxyAgent.ts View on Github external
export function createTunnel(
  isRequestHttps: boolean,
  isProxyHttps: boolean,
  tunnelOptions: tunnel.HttpsOverHttpsOptions
): http.Agent | https.Agent {
  if (isRequestHttps && isProxyHttps) {
    return tunnel.httpsOverHttps(tunnelOptions);
  } else if (isRequestHttps && !isProxyHttps) {
    return tunnel.httpsOverHttp(tunnelOptions);
  } else if (!isRequestHttps && isProxyHttps) {
    return tunnel.httpOverHttps(tunnelOptions);
  } else {
    return tunnel.httpOverHttp(tunnelOptions);
  }
}
github launchdarkly / node-server-sdk / index.js View on Github external
function createProxyAgent(config) {
  const options = {
    proxy: {
      host: config.proxyHost,
      port: config.proxyPort,
      proxyAuth: config.proxyAuth
    }
  };

  if (config.proxyScheme === 'https') {
    if (!config.baseUri || config.baseUri.startsWith('https')) {
      return tunnel.httpsOverHttps(options);
    } else {
      return tunnel.httpOverHttps(options);
    }
  } else if (!config.baseUri || config.baseUri.startsWith('https')) {
    return tunnel.httpsOverHttp(options);
  } else {
    return tunnel.httpOverHttp(options);
  }
}
github Azure / ms-rest-js / lib / proxyAgent.ts View on Github external
export function createTunnel(isRequestHttps: boolean, isProxyHttps: boolean, tunnelOptions: tunnel.HttpsOverHttpsOptions): http.Agent | https.Agent {
  if (isRequestHttps && isProxyHttps) {
    return tunnel.httpsOverHttps(tunnelOptions);
  } else if (isRequestHttps && !isProxyHttps) {
    return tunnel.httpsOverHttp(tunnelOptions);
  } else if (!isRequestHttps && isProxyHttps) {
    return tunnel.httpOverHttps(tunnelOptions);
  } else {
    return tunnel.httpOverHttp(tunnelOptions);
  }
}
github Azure / ms-rest-js / lib / axiosHttpClient.ts View on Github external
export function createTunnel(isRequestHttps: boolean, isProxyHttps: boolean, tunnelOptions: tunnel.HttpsOverHttpsOptions): http.Agent | https.Agent {
  if (isRequestHttps && isProxyHttps) {
    return tunnel.httpsOverHttps(tunnelOptions);
  } else if (isRequestHttps && !isProxyHttps) {
    return tunnel.httpsOverHttp(tunnelOptions);
  } else if (!isRequestHttps && isProxyHttps) {
    return tunnel.httpOverHttps(tunnelOptions);
  } else {
    return tunnel.httpOverHttp(tunnelOptions);
  }
}
github Azure / azure-sdk-for-java / ClientRuntimes / NodeJS / ms-rest / lib / filters / proxyFilter.js View on Github external
agentinfo.key = resource.key;
    }
    if (resource.cert) {
      agentinfo.cert = resource.cert;
    }

    var isOverHTTPS = utils.urlIsHTTPS(proxy);
    if (isHTTPS) {
      if (isOverHTTPS) {
        resource.agent = tunnel.httpsOverHttps(agentinfo);
      } else {
        resource.agent = tunnel.httpsOverHttp(agentinfo);
      }
    } else {
      if (isOverHTTPS) {
        resource.agent = tunnel.httpOverHttps(agentinfo);
      } else {
        resource.agent = tunnel.httpOverHttp(agentinfo);
      }
    }
  } else if (isHTTPS) {
    resource.agent = new https.Agent(resource);
  }
};

tunnel

Node HTTP/HTTPS Agents for tunneling proxies

MIT
Latest version published 6 years ago

Package Health Score

55 / 100
Full package analysis