Пример #1
0
func (this *Client) Authenticate(res, oldReq *msg.Message) (*Connection, error) {

	req := msg.NewRequest(msg.Request | msg.Binding)
	req.CopyAttributes(oldReq)

	r, _ := res.Attribute(msg.Realm)
	this.realm = r.(*msg.RealmAttr)

	nonce, _ := res.Attribute(msg.Nonce)
	this.nonce = nonce.(*msg.NonceAttr)

	return this.SendReqRes(req)
}
Пример #2
0
func (this *Client) Bind() (*Connection, error) {

	log.Println("Binding...")
	req := msg.NewRequest(msg.Request | msg.Binding)
	return this.SendReqRes(req)
}