heroiclabs / nakama

Distributed server for social and realtime games and apps.
https://heroiclabs.com
Apache License 2.0
8.58k stars 1.06k forks source link

Nakama Client SDKs should append port after host name instead of after full host path #1221

Open smsunarto opened 1 month ago

smsunarto commented 1 month ago

Currently, the Nakama client SDK will naively append the passed-in port after whatever is passed in as the host paramater

For example:

var client = new Nakama.Client("http", "127.0.0.1", 7350, "defaultkey");

will produce http://127.0.0.1:7350. Which works out just fine.


However, this becomes a problem when you use a path-based load balancer:

var client = new Nakama.Client("http", "example.com/nakama", 7350, "defaultkey");

The client SDK will append the port after the full path instead of the hostname, therefore producing -> http://example.com/nakama:7350 which is invalid. It should've been http://example.com:7350/nakama

Would be great if we can cover this edge case :D

linear[bot] commented 1 month ago

NK-557 Nakama Client SDKs should append port after host name instead of after full host path