blob: da87aa01078e6f82500c3b20c923eb3d3e0ad6d8 [file] [log] [blame]
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package proxy
import "v.io/v23/security"
// The proxy protocol is:
// (1) Server establishes a VC to the proxy to register its routing id and authenticate.
// (2) The server opens a flow and sends a "Request" message and waits for a "Response"
// message.
// (3) This flow is then kept alive with no more data read/written.
// Closure of this flow indicates that proxying has (or should be) stopped.
// (4) The proxy immediately closes any other flows on the VC.
// Request is the message sent by a server to request that the proxy route
// traffic intended for the server's RoutingId to the network connection
// between the server and the proxy.
type Request struct {
// Blessings of the server that wishes to be proxied.
// Used to authorize the use of the proxy.
Blessings security.WireBlessings
// Discharges required to make Blessings valid.
Discharges []security.WireDischarge
}
// Response is sent by the proxy to the server after processing Request.
type Response struct {
// Error is a description of why the proxy refused to proxy the server.
// A nil error indicates that the proxy will route traffic to the server.
Error error
// Endpoint is the string representation of an endpoint that can be
// used to communicate with the server through the proxy.
Endpoint string
}