MCPcopy
hub / github.com/AdguardTeam/dnsproxy / mustStartDefaultProxy

Function mustStartDefaultProxy

proxy/proxy_internal_test.go:279–293  ·  view source on GitHub ↗

mustStartDefaultProxy starts a new proxy with default settings and returns it. It fails the test on error.

(tb testing.TB)

Source from the content-addressed store, hash-verified

277// mustStartDefaultProxy starts a new proxy with default settings and returns
278// it. It fails the test on error.
279func mustStartDefaultProxy(tb testing.TB) (p *Proxy) {
280 tb.Helper()
281
282 p = mustNew(tb, &Config{
283 Logger: testLogger,
284 UDPListenAddr: []*net.UDPAddr{net.UDPAddrFromAddrPort(localhostAnyPort)},
285 TCPListenAddr: []*net.TCPAddr{net.TCPAddrFromAddrPort(localhostAnyPort)},
286 UpstreamConfig: newTestUpstreamConfig(tb, defaultTimeout, testDefaultUpstreamAddr),
287 TrustedProxies: defaultTrustedProxies,
288 })
289
290 servicetest.RequireRun(tb, p, testTimeout)
291
292 return p
293}
294
295// TestProxyRace sends multiple parallel DNS requests to the
296// fully configured dnsproxy to check for race conditions

Callers 5

TestProxy_tcpFunction · 0.85
TestResponseInRequestFunction · 0.85
TestUdpProxyFunction · 0.85

Calls 2

mustNewFunction · 0.85
newTestUpstreamConfigFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…