NineSec Team Shell
Server IP : 92.205.26.207  /  Your IP : 216.73.216.16
Web Server : Apache
System : Linux 207.26.205.92.host.secureserver.net 4.18.0-553.60.1.el8_10.x86_64 #1 SMP Thu Jul 10 04:01:16 EDT 2025 x86_64
User : zikryat ( 1002)
PHP Version : 8.3.23
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/zikryat/public_html/node_modules/sharp/lib/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/zikryat/public_html/node_modules/sharp/lib/agent.js
// Copyright 2013 Lovell Fuller and others.
// SPDX-License-Identifier: Apache-2.0

'use strict';

const url = require('url');
const tunnelAgent = require('tunnel-agent');

const is = require('./is');

const proxies = [
  'HTTPS_PROXY',
  'https_proxy',
  'HTTP_PROXY',
  'http_proxy',
  'npm_config_https_proxy',
  'npm_config_proxy'
];

function env (key) {
  return process.env[key];
}

module.exports = function (log) {
  try {
    const proxy = new url.URL(proxies.map(env).find(is.string));
    const tunnel = proxy.protocol === 'https:'
      ? tunnelAgent.httpsOverHttps
      : tunnelAgent.httpsOverHttp;
    const proxyAuth = proxy.username && proxy.password
      ? `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`
      : null;
    log(`Via proxy ${proxy.protocol}//${proxy.hostname}:${proxy.port} ${proxyAuth ? 'with' : 'no'} credentials`);
    return tunnel({
      proxy: {
        port: Number(proxy.port),
        host: proxy.hostname,
        proxyAuth
      }
    });
  } catch (err) {
    return null;
  }
};

NineSec Team - 2022