tmc / grpc-websocket-proxy

A proxy to transparently upgrade grpc-gateway streaming endpoints to use websockets
MIT License
553 stars 72 forks source link

[Bug] Leak #38

Open TheRealMal opened 3 months ago

TheRealMal commented 3 months ago

You call io.Pipe() at https://github.com/tmc/grpc-websocket-proxy/blob/673ab2c3ae75cc01952b84b88590e30e75dcf395/wsproxy/websocket_proxy.go#L186 then you lose it at https://github.com/tmc/grpc-websocket-proxy/blob/673ab2c3ae75cc01952b84b88590e30e75dcf395/wsproxy/websocket_proxy.go#L188 (When error happens at http.NewRequestWithContext you don't close requestBodyW and responseBodyW)

io.Pipe docs https://pkg.go.dev/io#Pipe