# Unet working in localhost only

**URL:** https://discussions.unity.com/t/unet-working-in-localhost-only/682481
**Category:** Multiplayer & Networking
**Tags:** UNet-Deprecated, com\_unity\_modules\_unet
**Created:** [November 11, 2017, 8:03pm UTC](https://discussions.unity.com/t/unet-working-in-localhost-only/682481 "2017-11-11T20:03:32Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![FlynnSP](https://avatars.discourse-cdn.com/v4/letter/f/bb73d2/32.png) [@FlynnSP](https://discussions.unity.com/u/FlynnSP)
#### Post date: [November 11, 2017, 8:03pm UTC](https://discussions.unity.com/t/unet-working-in-localhost-only/682481/1 "2017-11-11T20:03:32Z")

</div>

Hi.  
I’m quite a newbie with Unity Networking, so please forgive me if this question seems stupid to you, but I’m having a little problem.

I’m trying to make an online game for 2 players only, and I first tried my game locally with Unet from Unity 5. I managed to write that script which connect two people (one is hosting, one is joining).

```csharp
public class CustomNetworkManager : NetworkManager {

    public void StartupHost () {

        SetPort ();
        NetworkManager.singleton.StartHost ();
    }

    public void JoinGame () {

        NetworkManager.singleton.networkAddress = GameObject.Find("IpText").GetComponent<Text>().text;
        SetPort ();
        NetworkManager.singleton.StartClient ();
    }

    void SetPort () {

        NetworkManager.singleton.networkPort = 7777;
    }
}

```

StartupHost is called for the player who’s hosting, JoinGame is called for the Client joining the game.  
When setting localhost as the network address, all went well. But when I tried to use the IP port instead, nothing happend.

What am I doing wrong ? Network address isn’t the IP address ? Do I need to call StartClient() or setup connections ?

---

<div class="post-metadata">

### Author: ![FlynnSP](https://avatars.discourse-cdn.com/v4/letter/f/bb73d2/32.png) [@FlynnSP](https://discussions.unity.com/u/FlynnSP)
#### Post date: [November 13, 2017, 8:21am UTC](https://discussions.unity.com/t/unet-working-in-localhost-only/682481/2 "2017-11-13T08:21:57Z")

</div>

Up. 🙄
