MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / shouldBypassProxy

Function shouldBypassProxy

freebuff/cli/release/http.js:23–39  ·  view source on GitHub ↗
(hostname)

Source from the content-addressed store, hash-verified

21 }
22
23 function shouldBypassProxy(hostname) {
24 const noProxy = env.NO_PROXY || env.no_proxy || ''
25 if (!noProxy) return false
26
27 const domains = noProxy
28 .split(',')
29 .map((domain) => domain.trim().toLowerCase().replace(/:\d+$/, ''))
30 const host = hostname.toLowerCase()
31
32 return domains.some((domain) => {
33 if (domain === '*') return true
34 if (domain.startsWith('.')) {
35 return host.endsWith(domain) || host === domain.slice(1)
36 }
37 return host === domain || host.endsWith(`.${domain}`)
38 })
39 }
40
41 function connectThroughProxy(proxyUrl, targetHost, targetPort) {
42 return new Promise((resolve, reject) => {

Callers 1

buildRequestOptionsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected