Closed steotia closed 4 years ago
Got it. For bidi comms, the GET /echo has to be modified to become POST /echo. Can be achieved via
var wsopts []wsproxy.Option
wsopts = append(wsopts, wsproxy.WithMethodParamOverride("POST"))
http.ListenAndServe(*httpAddr, wsproxy.WebsocketProxy(mux, wsopts...))
This is not very obvious
@steotia Were you able to connect to the server using the browser web socket client or another? I receive a 405 Method Not Allowed
, but haven't investigated much further.
For the WebSocket example
GET
on/echo
I am unable to read anything from the socket, only able to write back. Reading simply returns an errorEOF
, when trying toRecvMsg
in the gRPC server.