Easy way to use PUN over LAN?

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Easy way to use PUN over LAN?

steverock
2018-05-22 01:09:01

Hi all,
While PUN's cloud-hosted servers and lobbies are a great convenience, it would also be great if I could connect only over my LAN. I'm working on an internal prototype/demo, so I don't need to connect players across the internet, and so it would be nice to ignore latency for now and just do it all over LAN. Is this possible?

Comments

[Deleted User]
2018-05-22 09:41:16

Hi @steverock,

you can host the Photon Server yourself on your or another computer on your local network and let the clients connect to this server. This way all game relevant traffic should 'stay' inside your local network. The server itself however requires an internet connection if I'm not mistaken. You can find the Server SDK here.

When running the server it already has a working Loadbalancing Application which you can use. This is basically the same which as in the Cloud. Inside your Unity project, you have to change the settings in the PhotonServerSettings file: set hosting to 'self hosted' and enter the server's IP address.

steverock
2018-05-22 16:12:57

Great, thanks. I'll give that a spin today. I guess the simplest thing we can do is have the master client also run the server, and everyone connects to his/her IP. Just for a prototype.

steverock
2018-05-22 17:51:53

Got it working, but I'm seeing a lot of latency even all on the same computer. Posted follow up question here: https://forum.photonengine.com/discussion/11918/local-latency#latest

Back to top