add warp in warp & reserved & more more
This commit is contained in:
@@ -213,6 +213,12 @@ func ChangeConfigOptions(in *pb.ChangeConfigOptionsRequest) (*pb.CoreInfoRespons
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if configOptions.Warp2.WireguardConfigStr != "" {
|
||||
err := json.Unmarshal([]byte(configOptions.Warp2.WireguardConfigStr), &configOptions.Warp2.WireguardConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return &pb.CoreInfoResponse{}, nil
|
||||
}
|
||||
func (s *CoreService) GenerateConfig(ctx context.Context, in *pb.GenerateConfigRequest) (*pb.GenerateConfigResponse, error) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
func main() {
|
||||
|
||||
// defer C.free(unsafe.Pointer(port))
|
||||
v2.StartGrpcServer("127.0.0.1:50051")
|
||||
v2.StartGrpcServer("127.0.0.1:50051", "hello")
|
||||
sigChan := make(chan os.Signal, 1)
|
||||
signal.Notify(sigChan, os.Interrupt, syscall.SIGTERM)
|
||||
<-sigChan
|
||||
|
||||
@@ -239,6 +239,11 @@ func readConfigOptionsAt(path string) (*config.ConfigOptions, error) {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
if options.Warp2.WireguardConfigStr != "" {
|
||||
err := json.Unmarshal([]byte(options.Warp2.WireguardConfigStr), &options.Warp2.WireguardConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return &options, nil
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ func GenerateWarpConfig(in *pb.GenerateWarpConfigRequest) (*pb.WarpGenerationRes
|
||||
LocalAddressIpv4: wg.LocalAddressIPv4,
|
||||
LocalAddressIpv6: wg.LocalAddressIPv6,
|
||||
PeerPublicKey: wg.PeerPublicKey,
|
||||
ClientId: wg.ClientID,
|
||||
},
|
||||
Log: log,
|
||||
}, nil
|
||||
|
||||
Reference in New Issue
Block a user