func ClientDial(addr transport.Address, id *identity.TokenId, serviceId *identity.TokenId, tcfg transport.Configuration) (transport.Connection, error) {
	peer, err := addr.Dial("i/"+id.Token, id, 0, tcfg)
	if err != nil {
		return nil, err
	}
	request := &xgress.Request{
		Id:        id.Token,
		ServiceId: serviceId.Token,
	}
	err = xgress.SendRequest(request, peer.Writer())
	if err != nil {
		return nil, err
	}
	response, err := xgress.ReceiveResponse(peer)
	if err != nil {
		return nil, err
	}
	if !response.Success {
		return nil, errors.New(response.Message)
	}
	return peer, nil
}
ClientDial dials the given xgress address and handles authentication, returning an authed connection or an error
package xgress_transport
import (
	"errors"
	"github.com/openziti/fabric/router/xgress"
	"github.com/openziti/foundation/identity/identity"
	"github.com/openziti/foundation/transport"
)