Simple create/connectto server without Masterserver and joining by IP

Hey! I am quite new to programming and fail to understand many concepts relating to Networking.

As I assume Masterserver is like a database which registers and returns a list of all your Internet games(like a server browser in CS, CS:S, TF2 and so on), which other people can see and connect to. It also allows people without public IPs to be seen and be reachable for other people.

I have a question: is it possible to do without Masterserver at all? Is there a possibility that a person can create his own server with a mouse click; and another person be able to connect just by inputting IP address and a Port? (Like it is done in Terraria). If yes: what is the code to instantiate and/or connect to a server?

Thank you very much for help!

Sure it’s possible. You always start a server by using Network.InitializeServer and others can use Network.Connect with an ip or domain name and a port. The Masterserver is completely optional. However keep in mind that the one that hosts the server need to be reachable from outside, so he/she needs to port-forward your server port.