frp/pkg/config/legacy/value.go
import (
"bytes"
"os"
"strings"
"text/template"
"frp/pkg/util/util"
)
func GetRenderedConfFromFile(Path string) (out []byte, err error) {
var buf []byte
if strings.Contains(Path, "://") {
buf, err = util.HTTP("GET", Path, map[string]string{"User-Agent": ""}, nil)
if err != nil {
return
}
} else {
buf, err = os.ReadFile(Path)
if err != nil {
return
}
}
out, err = RenderContent(buf)
return
}