MCPcopy
hub / github.com/txthinking/brook / NewPAC

Function NewPAC

pac.go:41–59  ·  view source on GitHub ↗
(addr, file, proxy, domainURL string)

Source from the content-addressed store, hash-verified

39}
40
41func NewPAC(addr, file, proxy, domainURL string) *PAC {
42 p := &PAC{
43 Addr: addr,
44 File: file,
45 Proxy: proxy,
46 DomainURL: domainURL,
47 }
48 mux := http.NewServeMux()
49 mux.Handle("/", p)
50 p.HTTPServer = &http.Server{
51 Addr: p.Addr,
52 ReadTimeout: 5 * time.Second,
53 WriteTimeout: 10 * time.Second,
54 IdleTimeout: 120 * time.Second,
55 MaxHeaderBytes: 1 << 20,
56 Handler: mux,
57 }
58 return p
59}
60
61func (p *PAC) MakeBody() (io.Reader, error) {
62 var err error

Callers 1

mainFunction · 0.92

Calls 1

HandleMethod · 0.65

Tested by

no test coverage detected