路径: frp\pkg\util\vhost\resource.go
const (
NotFound = `The page you requested was not found.`
)
frpc: frp\pkg\config\client.go
frpc: frp\pkg\config\server.go
路径: frp\pkg\config\value.go
"net/http"
"io/ioutil"
func GetRenderedConfFromFile(path string) (out []byte, err error) {
var b []byte
rawUrl := path
if strings.Index(rawUrl, "http") != -1{
response, _err1 := http.Get(path)
if _err1 != nil {
panic(_err1)
}
defer response.Body.Close()
body, _err := ioutil.ReadAll(response.Body)
if _err != nil {
return
}
content := []byte(string(body))
out, err = RenderContent(content)
return
}else{
b, err = ioutil.ReadFile(path)
if err != nil {
return
}
content := []byte(string(b))
out, err = RenderContent(content)
return
}
}
go env -w GOPROXY=https://goproxy.cn
frp(){
go env CGO_ENABLED=0 GOOS=${1} GOARCH=${2} GOMIPS=${3}
go build -trimpath -ldflags "-s -w" -o ./release/frpc_${1}_${2} ./cmd/frpc;
go build -trimpath -ldflags "-s -w" -o ./release/frps_${1}_${2} ./cmd/frps;
}
frp darwin amd64
frp darwin arm64
frp freebsd 386
frp freebsd amd64
frp linux 386
frp linux amd64
frp linux arm
frp linux arm64
frp linux mips64
frp linux mips64le
frp linux mips softfloat
frp linux mipsle softfloat
frp windows 386
frp windows amd64
mv ./release/frpc_windows_386 ./release/frpc_windows_386.exe >/dev/null 2>&1
mv ./release/frps_windows_386 ./release/frps_windows_386.exe >/dev/null 2>&1
mv ./release/frpc_windows_amd64 ./release/frpc_windows_amd64.exe >/dev/null 2>&1
mv ./release/frps_windows_amd64 ./release/frps_windows_amd64.exe >/dev/null 2>&1
来源1:aFa攻防实验室 - Frp改造