__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
'use strict'
// Taken from https://github.com/request/request/blob/212570b/lib/getProxyFromURI.js
const url = require('url')
function formatHostname (hostname) {
// canonicalize the hostname, so that 'oogle.com' won't match 'google.com'
return hostname.replace(/^\.*/, '.').toLowerCase()
}
function parseNoProxyZone (zone) {
zone = zone.trim().toLowerCase()
var zoneParts = zone.split(':', 2)
var zoneHost = formatHostname(zoneParts[0])
var zonePort = zoneParts[1]
var hasPort = zone.indexOf(':') > -1
return { hostname: zoneHost, port: zonePort, hasPort: hasPort }
}
function uriInNoProxy (uri, noProxy) {
var port = uri.port || (uri.protocol === 'https:' ? '443' : '80')
var hostname = formatHostname(uri.hostname)
var noProxyList = noProxy.split(',')
// iterate through the noProxyList until it finds a match.
return noProxyList.map(parseNoProxyZone).some(function (noProxyZone) {
var isMatchedAt = hostname.indexOf(noProxyZone.hostname)
var hostnameMatched = (
isMatchedAt > -1 &&
(isMatchedAt === hostname.length - noProxyZone.hostname.length)
)
if (noProxyZone.hasPort) {
return (port === noProxyZone.port) && hostnameMatched
}
return hostnameMatched
})
}
function getProxyFromURI (gyp, env, uri) {
// If a string URI/URL was given, parse it into a URL object
if (typeof uri === 'string') {
// eslint-disable-next-line
uri = url.parse(uri)
}
// Decide the proper request proxy to use based on the request URI object and the
// environmental variables (NO_PROXY, HTTP_PROXY, etc.)
// respect NO_PROXY environment variables (see: https://lynx.invisible-island.net/lynx2.8.7/breakout/lynx_help/keystrokes/environments.html)
var noProxy = gyp.opts.noproxy || env.NO_PROXY || env.no_proxy || env.npm_config_noproxy || ''
// if the noProxy is a wildcard then return null
if (noProxy === '*') {
return null
}
// if the noProxy is not empty and the uri is found return null
if (noProxy !== '' && uriInNoProxy(uri, noProxy)) {
return null
}
// Check for HTTP or HTTPS Proxy in environment Else default to null
if (uri.protocol === 'http:') {
return gyp.opts.proxy ||
env.HTTP_PROXY ||
env.http_proxy ||
env.npm_config_proxy || null
}
if (uri.protocol === 'https:') {
return gyp.opts.proxy ||
env.HTTPS_PROXY ||
env.https_proxy ||
env.HTTP_PROXY ||
env.http_proxy ||
env.npm_config_proxy || null
}
// if none of that works, return null
// (What uri protocol are you using then?)
return null
}
module.exports = getProxyFromURI
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Find-VisualStudio.cs | File | 7.75 KB | 0644 |
|
| build.js | File | 5.16 KB | 0644 |
|
| clean.js | File | 355 B | 0644 |
|
| configure.js | File | 12.04 KB | 0644 |
|
| find-node-directory.js | File | 2.32 KB | 0644 |
|
| find-python.js | File | 10.88 KB | 0644 |
|
| find-visualstudio.js | File | 13.53 KB | 0644 |
|
| install.js | File | 14.01 KB | 0644 |
|
| list.js | File | 641 B | 0644 |
|
| node-gyp.js | File | 4.57 KB | 0644 |
|
| process-release.js | File | 5.65 KB | 0644 |
|
| proxy.js | File | 2.57 KB | 0644 |
|
| rebuild.js | File | 314 B | 0644 |
|
| remove.js | File | 1.28 KB | 0644 |
|
| util.js | File | 1.87 KB | 0644 |
|