# How to find ip address of my pc and phone?

**URL:** <https://forums.solar2d.com/t/how-to-find-ip-address-of-my-pc-and-phone/347849>\
**Category:** Corona Live Builds\
**Created:** [June 15, 2018, 6:57am UTC](https://forums.solar2d.com/t/how-to-find-ip-address-of-my-pc-and-phone/347849 "2018-06-15T06:57:51Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![DevilDev](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/d/aca169/32.png) [@DevilDev](https://forums.solar2d.com/u/DevilDev)\
**Post date:** [June 15, 2018, 6:57am UTC](https://forums.solar2d.com/t/how-to-find-ip-address-of-my-pc-and-phone/347849/1 "2018-06-15T06:57:51Z")

</div>

My phone and windows laptop is connected to same wifi…

---

<div class="post-metadata">

**Author:** ![nick\_sherman](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/n/958977/32.png) [@nick\_sherman](https://forums.solar2d.com/u/nick_sherman)\
**Post date:** [June 15, 2018, 8:04am UTC](https://forums.solar2d.com/t/how-to-find-ip-address-of-my-pc-and-phone/347849/2 "2018-06-15T08:04:32Z")

</div>

Type ‘what is my ip’ into google.

---

<div class="post-metadata">

**Author:** ![DevilDev](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/d/aca169/32.png) [@DevilDev](https://forums.solar2d.com/u/DevilDev)\
**Post date:** [June 15, 2018, 8:07am UTC](https://forums.solar2d.com/t/how-to-find-ip-address-of-my-pc-and-phone/347849/3 "2018-06-15T08:07:41Z")

</div>

@nick

thanks for response.But google returns my public ip.I have to find the local wifi ip…

---

<div class="post-metadata">

**Author:** ![DevilDev](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/d/aca169/32.png) [@DevilDev](https://forums.solar2d.com/u/DevilDev)\
**Post date:** [June 15, 2018, 8:13am UTC](https://forums.solar2d.com/t/how-to-find-ip-address-of-my-pc-and-phone/347849/4 "2018-06-15T08:13:44Z")

</div>

Googled it…Thanks

---

<div class="post-metadata">

**Author:** ![roaminggamer](https://forums.solar2d.com/user_avatar/forums.solar2d.com/roaminggamer/32/134_2.png) [@roaminggamer](https://forums.solar2d.com/u/roaminggamer)\
**Post date:** [June 15, 2018, 3:41pm UTC](https://forums.solar2d.com/t/how-to-find-ip-address-of-my-pc-and-phone/347849/5 "2018-06-15T15:41:06Z")

</div>

```
local socket = require( "socket" ) local function getIP( testIP ) testIP = testIP or "74.125.115.104" local s = socket.udp() s:setpeername( testIP, 80 ) local ip, sock = s:getsockname() return ip end print("IP: ", getIP("1.1.1.1") )

```

Each device on your WiFi network will have its own IP address.

If you are actually asking, “How do I get the IP of my home modem/router as set by my internet provider?” I don’t know.

---

<div class="post-metadata">

**Author:** ![nick\_sherman](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/n/958977/32.png) [@nick\_sherman](https://forums.solar2d.com/u/nick_sherman)\
**Post date:** [June 15, 2018, 8:04am UTC](https://forums.solar2d.com/t/how-to-find-ip-address-of-my-pc-and-phone/347849/6 "2018-06-15T08:04:32Z")

</div>

Type ‘what is my ip’ into google.

---

<div class="post-metadata">

**Author:** ![DevilDev](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/d/aca169/32.png) [@DevilDev](https://forums.solar2d.com/u/DevilDev)\
**Post date:** [June 15, 2018, 8:07am UTC](https://forums.solar2d.com/t/how-to-find-ip-address-of-my-pc-and-phone/347849/7 "2018-06-15T08:07:41Z")

</div>

@nick

thanks for response.But google returns my public ip.I have to find the local wifi ip…

---

<div class="post-metadata">

**Author:** ![DevilDev](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/d/aca169/32.png) [@DevilDev](https://forums.solar2d.com/u/DevilDev)\
**Post date:** [June 15, 2018, 8:13am UTC](https://forums.solar2d.com/t/how-to-find-ip-address-of-my-pc-and-phone/347849/8 "2018-06-15T08:13:44Z")

</div>

Googled it…Thanks

---

<div class="post-metadata">

**Author:** ![roaminggamer](https://forums.solar2d.com/user_avatar/forums.solar2d.com/roaminggamer/32/134_2.png) [@roaminggamer](https://forums.solar2d.com/u/roaminggamer)\
**Post date:** [June 15, 2018, 3:41pm UTC](https://forums.solar2d.com/t/how-to-find-ip-address-of-my-pc-and-phone/347849/9 "2018-06-15T15:41:06Z")

</div>

```
local socket = require( "socket" ) local function getIP( testIP ) testIP = testIP or "74.125.115.104" local s = socket.udp() s:setpeername( testIP, 80 ) local ip, sock = s:getsockname() return ip end print("IP: ", getIP("1.1.1.1") )

```

Each device on your WiFi network will have its own IP address.

If you are actually asking, “How do I get the IP of my home modem/router as set by my internet provider?” I don’t know.
