Direct messaging between players

Hello! In game i’m currently developing, i need some matchmaking functionality (for that i’m using NetworkManager.matchMaker), but after match created, i want to make messaging between players directly, without relay server. How can i implement it?

That’s the million dollar question.

Currently UNET supports…
1: Relay server/matchmaker
2: LAN connection (enter IP). Does not work through router firewalls (unless you port forward and such)

But they do not support NAT punch through (yet) or any sort of connection server to link players.

Note also that Unet does not support p2p networking, all Unet is client-server architecture. Ie. if you have a 5 player game, 1 player is the “server/host” and the others call connect to that one player. You don’t have 5 players, each with a connection to each other player, in a “true” peer to peer network architecture. Unity’s relay server then adds an addition step in the configuration, but it still is client/server and not p2p.