mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-06 05:30:05 +00:00
Web 服务
This commit is contained in:
26
cmd/dashboard/rpc/rpc.go
Normal file
26
cmd/dashboard/rpc/rpc.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package rpc
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
|
||||
pb "github.com/p14yground/nezha/proto"
|
||||
rpcService "github.com/p14yground/nezha/service/rpc"
|
||||
)
|
||||
|
||||
// ServeRPC ...
|
||||
func ServeRPC() {
|
||||
server := grpc.NewServer()
|
||||
pb.RegisterNezhaServiceServer(server, &rpcService.NezhaHandler{
|
||||
Auth: &rpcService.AuthHandler{
|
||||
AppKey: "naiba",
|
||||
AppSecret: "123456",
|
||||
},
|
||||
})
|
||||
listen, err := net.Listen("tcp", ":5555")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
server.Serve(listen)
|
||||
}
|
||||
Reference in New Issue
Block a user