code: func (conn *Conn) write(num byte, data []byte) (int, error) {
  	conn.resetTimeout()
  	switch conn.codec {
  	case rawCodec:
  		frame := make([]byte, len(data)+1)
  		frame[0] = num
  		copy(frame[1:], data)
  		if err := websocket.Message.Send(conn.ws, frame); err != nil {
  			return 0, err
  		}
  	case base64Codec:
  		frame := string('0'+num) + base64.StdEncoding.EncodeToString(data)
  		if err := websocket.Message.Send(conn.ws, frame); err != nil {
  			return 0, err
  		}
  	}
  	return len(data), nil
  }
docs: // write multiplexes the specified channel onto the websocket