proxy.New: assembly as a library module #47
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
mikluko/multiproxy!47
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/proxy-module"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Candidate 5 of the architecture review.
How the router, handlers and middleware fit together lived in the command's
newHandler, and library users had to copy it. The*fallback rule was split: the router matched host patterns while the command turned*into theConnectfallback.proxy.New(proxy.Config)builds the proxy from host patterns, an Issuer, middleware for plain-HTTP and intercepted requests, the two header switches, loggers and the tunnel dial timeout. It is at 100% coverage, andExampleNewis the same code as the how-to.router.Router.HandleConnectHost("*", h)sets the fallback, whenever it is added. A*in both MITM and Tunnel is an error fromproxy.New.proxy.New, so library callers get it too.proxy.Config, and header rewriting becomes oneMiddlewareentry.registerHandler,namedandspanNamemove out;main.goloses about 60 lines.The header-rewriting how-to's Go section now uses
proxy.New. The suite passes three times in a row under-race.