Reader reads from the connection until there is a WebSocket data message to be read. It will handle ping, pong and close frames as appropriate. It returns the type of the message and an io.Reader to read it. The passed context will also bound the reader. Ensure you read to EOF otherwise the connect
(ctx context.Context)
| 33 | // See https://github.com/nhooyr/websocket/issues/87#issue-451703332 |
| 34 | // Most users should not need this. |
| 35 | func (c *Conn) Reader(ctx context.Context) (MessageType, io.Reader, error) { |
| 36 | return c.reader(ctx) |
| 37 | } |
| 38 | |
| 39 | // Read is a convenience method around Reader to read a single message |
| 40 | // from the connection. |