func (p *Proxy) ServeRequest(ctx context.Context, req server.Request, rsp server.Response) error {
	if p.Endpoint == "" {
		exe, err := os.Executable()
		if err != nil {
			return err
		}
		p.Endpoint = filepath.Dir(exe)
	}
	for {
		_, err := req.Read()
		if err == io.EOF {
			return nil
		}
		if err != nil {
			return err
		}
		hdr := req.Header()
		endpoint := getEndpoint(hdr)
		file := filePath(p.Endpoint, endpoint)
		b, err := ioutil.ReadFile(file)
		if err != nil {
			return errors.InternalServerError(req.Service(), err.Error())
		}
		rsp.WriteHeader(hdr)
		err = rsp.Write(b)
		if err == io.EOF {
			return nil
		}
		if err != nil {
			return errors.InternalServerError(req.Service(), err.Error())
		}
	}
}
ServeRequest honours the server.Router interface
package file
import (
	"context"
	"io"
	"io/ioutil"
	"os"
	"path/filepath"
	"strings"
	"github.com/micro/micro/v3/service/errors"
	"github.com/micro/micro/v3/service/proxy"
	"github.com/micro/micro/v3/service/server"
)
type Proxy struct {
	options proxy.Options
	Endpoint string
}
func filePath(eps ...string) string {
	p := filepath.Join(eps...)
	return strings.Replace(p, "../", "", -1)
}
func getMethod(hdr map[string]string) string {
	switch hdr["Micro-Method"] {
	case "read", "write":
		return hdr["Micro-Method"]
	default:
		return "read"
	}
}
func getEndpoint(hdr map[string]string) string {
	ep := hdr["Micro-Endpoint"]
	if len(ep) > 0 && ep[0] == '/' {
		return ep
	}
	return ""
}
func (p *Proxy) ProcessMessage(ctx context.Context, msg server.Message) error {
	return nil
}