Register is used by CLI clients to register with the RPC server
(ctx context.Context, e *emptypb.Empty)
| 184 | |
| 185 | // Register is used by CLI clients to register with the RPC server |
| 186 | func (s *Server) Register(ctx context.Context, e *emptypb.Empty) (*pb.ID, error) { |
| 187 | slog.Log(context.Background(), logging.LevelTrace, "entering into function", "context", ctx, "empty", e) |
| 188 | cliClient := client.NewClient() |
| 189 | s.clientRepo.Add(cliClient) |
| 190 | s.messageChan[cliClient.ID()] = make(chan *pb.Message, 100) |
| 191 | slog.Info(fmt.Sprintf("Registered new RPC client with ID %s", cliClient.ID())) |
| 192 | return &pb.ID{Id: cliClient.ID().String()}, nil |
| 193 | } |
| 194 | |
| 195 | // Socks creates a TCP listener on the provided port and forwards SOCKS5 traffic to the provided agent |
| 196 | // in.Arguments[0] = method |