feat: export client to dynamic lib
This commit is contained in:
parent
8f105adbca
commit
13b82e8131
4
Makefile
4
Makefile
@ -27,9 +27,11 @@ vet:
|
|||||||
|
|
||||||
frps:
|
frps:
|
||||||
env CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o bin/frps ./cmd/frps
|
env CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o bin/frps ./cmd/frps
|
||||||
|
# go build -trimpath -ldflags "-s -w" -o bin/frps ./cmd/frps
|
||||||
|
|
||||||
frpc:
|
frpc:
|
||||||
env CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o bin/frpc ./cmd/frpc
|
env CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -buildmode=c-shared -o bin/frpc ./cmd/frpc
|
||||||
|
#env CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -buildmode=c-shared -o bin/frpc ./cmd/frpc
|
||||||
|
|
||||||
test: gotest
|
test: gotest
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ app:
|
|||||||
gomips=$(shell echo "$(n)" | cut -d : -f 3);\
|
gomips=$(shell echo "$(n)" | cut -d : -f 3);\
|
||||||
target_suffix=$${os}_$${arch};\
|
target_suffix=$${os}_$${arch};\
|
||||||
echo "Build $${os}-$${arch}...";\
|
echo "Build $${os}-$${arch}...";\
|
||||||
env CGO_ENABLED=0 GOOS=$${os} GOARCH=$${arch} GOMIPS=$${gomips} go build -trimpath -ldflags "$(LDFLAGS)" -o ./release/frpc_$${target_suffix} ./cmd/frpc;\
|
env CGO_ENABLED=0 GOOS=$${os} GOARCH=$${arch} GOMIPS=$${gomips} go build -trimpath -ldflags "$(LDFLAGS)" -buildmode=c-shared -o ./release/frpc_$${target_suffix} ./cmd/frpc;\
|
||||||
env CGO_ENABLED=0 GOOS=$${os} GOARCH=$${arch} GOMIPS=$${gomips} go build -trimpath -ldflags "$(LDFLAGS)" -o ./release/frps_$${target_suffix} ./cmd/frps;\
|
env CGO_ENABLED=0 GOOS=$${os} GOARCH=$${arch} GOMIPS=$${gomips} go build -trimpath -ldflags "$(LDFLAGS)" -o ./release/frps_$${target_suffix} ./cmd/frps;\
|
||||||
echo "Build $${os}-$${arch} done";\
|
echo "Build $${os}-$${arch} done";\
|
||||||
)
|
)
|
||||||
|
@ -14,11 +14,25 @@
|
|||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
import "C"
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
_ "github.com/fatedier/frp/assets/frpc"
|
_ "github.com/fatedier/frp/assets/frpc"
|
||||||
"github.com/fatedier/frp/cmd/frpc/sub"
|
"github.com/fatedier/frp/cmd/frpc/sub"
|
||||||
|
"os"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
sub.Execute()
|
//sub.Execute()
|
||||||
|
}
|
||||||
|
|
||||||
|
func frpstart(charargs *C.char) {
|
||||||
|
var stringargs string
|
||||||
|
stringargs = C.GoString(charargs)
|
||||||
|
err := sub.runMultipleClients(stringargs)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user