Telanflow
Telanflow
Yes, I know. MITM does not use connection pooling, and I am still considering a solution. The tunnel agent has used the connection pool. https://github.com/telanflow/mps/blob/668b4ac974bbc66848672bcdd0c2150a5b74406c/mitm_handler.go#L133-L193
the reason for the `TLS handshake` should be that you did not reuse the connection for each request. You need to pay attention to: The client needs to reuse the...
You should instantiate mitmHandler as follows: ``` proxyInstance := mps.NewHttpProxy() // Use the same mps.Context instance mitmHandler := mps.NewMitmHandlerWithContext(proxyInstance.Ctx) // Process the CONNECT request proxyInstance.HandleConnect = mitmHandler ``` Because middleware...
I'm sorry, i went out to play on China National Day. you can do that: ```go // set value ctx.Context = context.WithValue(ctx.Context, "testid", testID) // get value ctx.Context.Value("testId") ``` Or...
yes, It's best to set it above the request `Context`
Each request spawns a new Handler for the execution middleware (MITMHandler, TunnelHandler) ``` ctx := mitm.Ctx.WithRequest(req) resp, err := ctx.Next(req) ``` eg. https://github.com/telanflow/mps/blob/00583b5f72a7c282848f6288036ca915813408d1/mitm_handler.go#L94-L108 https://github.com/telanflow/mps/blob/00583b5f72a7c282848f6288036ca915813408d1/tunnel_handler.go#L44-L58
Take a look at the latest submission so that should work @hazcod
Is this row not getting the value? ```go log.Info(req.Context().Value("testid")) ``` Where do they set a testid? one thing to note: set `testid` middleware has to come in front of OnRequest
I'm sorry. I've been a little busy lately. The code is as follows: ```go func main() { proxy := mps.NewHttpProxy() proxy.HandleConnect = mps.NewMitmHandlerWithContext(proxy.Ctx) proxy.OnRequest().DoFunc(func(req *http.Request, ctx *mps.Context) (*http.Request, *http.Response) {...
you should know that an HTTP request is executed sequentially to the middleware, and if middleware 1 skips it, middleware 2 will not get the value. ``` GET -> middleware1...