Distinguish different endpoints?

i need to force a request only to respond to grpc or rest endpoint. how it works?

as i researched, there is only the RegisterRpc method on the Golang extension library. and i think if the port is open for a certain endpoint type, all methods respond to that type. so is there any way to limit Rpc to work on a target Endpoint?

Hello @virtouso, I’m not sure I understood what you’re asking, can you give an example please?

assume I have an AddGold method on the server plugin or a nakama builtin method, like Authenticate With Google. I need these 2 methods only accessed through HTTP Rest and no sockets or grpc.

You can add some Guards that check the context - if SESSION_ID is present then it’s a socket connection and you can return early to prevent the function from executing.

I don’t think the server currently allows disabling the gRPC port. In a typical production deployment you’d have a Load Balancer in front of the server that could disallow certain ports to be reached.