func ProcessHandshake(client net.Conn, mysql net.Conn) (*HandshakeV10, *HandshakeResponse41, error) {
	packet, err := ProxyPacket(mysql, client)
	if err != nil {
		println(err.Error())
		return nil, nil, err
	}
	serverHandshake, err := DecodeHandshakeV10(packet)
	if err != nil {
		println(err.Error())
		return nil, nil, err
	}
	packet, err = ProxyPacket(client, mysql)
	if err != nil {
		println(err.Error())
		return nil, nil, err
	}
	clientHandshake, err := DecodeHandshakeResponse41(packet)
	if err != nil {
		println(err.Error())
		return nil, nil, err
	}
	if _, err = ProxyPacket(mysql, client); err != nil {
		println(err.Error())
		return nil, nil, err
	}
	return serverHandshake, clientHandshake, nil
}
ProcessHandshake handles handshake between server and client.
Returns server and client handshake responses
package protocol
import (
	"bytes"
	"encoding/binary"
	"io"
	"net"
)
type ConnSettings struct {
	ClientCapabilities uint32
	ServerCapabilities uint32
	SelectedDb         string
}
func (h *ConnSettings) DeprecateEOFSet() bool {
	return ((clientDeprecateEOF & h.ServerCapabilities) != 0) &&
		((clientDeprecateEOF & h.ClientCapabilities) != 0)
}