Multiplayer password hosting

Hey does anyone here know how to make a multiplayer menu where you can host games and set a password for it then someone else on a different internet for example can enter the password for that server and join them in game? If that makes sense