tmc/grpc-websocket-proxy

Does not work after upgrading to grpc gateway 1.7.

hijamoya opened this issue · 3 comments

Works great before upgrading. After upgrading, the client can not receive the streaming response.

In grpc gateway 1.7, the pb.gw.go file

dec := marshaler.NewDecoder(req.Body)

change to

	newReader, berr := utilities.IOReaderFactory(req.Body)
	if berr != nil {
		return nil, metadata, berr
	}
	dec := marshaler.NewDecoder(newReader())

makes the response can not be delivered.

Refer: grpc-ecosystem/grpc-gateway@d8ad87e#diff-57c67d14e7ad37c6f4d7d77e14daf3d8

Hm, is the problem that it's no longer streaming the request body? It tries to read the whole thing? This could potentially be fixed with an *io.Pipe in the grpc-gateway.

The reason this function was introduced was because we needed a way to read the body several times. There may be a way to have both streaming of the body and the ability to read-from-the-start with some experimentation. It might be worth raising a bug in grpc-gateway if you can nail down exactly why this happened (but I suspect it's the ReadAll call blocking the request body).

I think we can close this in favor of grpc-ecosystem/grpc-gateway#894.