Unable to read from socket
steotia opened this issue · 2 comments
steotia commented
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 error EOF
, when trying to RecvMsg
in the gRPC server.
steotia commented
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
jacobnosal commented
@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.