@Override
	public HandshakeState acceptHandshakeAsClient(Handshakedata request,
			Handshakedata response) throws Exception {
		if (!request.hasFieldValue("Sec-WebSocket-Key")
				|| !response.hasFieldValue("Sec-WebSocket-Accept"))
			return HandshakeState.NOT_MATCHED;

		String seckey_answere = response.getFieldValue("Sec-WebSocket-Accept");
		String seckey_challenge = request.getFieldValue("Sec-WebSocket-Key");
		seckey_challenge = generateFinalKey(seckey_challenge);

		if (seckey_challenge.equals(seckey_answere))
			return HandshakeState.MATCHED;
		return HandshakeState.NOT_MATCHED;
	}