2

I running a webserver on my computer. And I want to control and use from my android phone. (physical device)

I'm using WAMP Server on Windows 10.

Is this possible? If it is, what should i do?

Thanks in advance!

  • I guess "localhost" is only one of faces of Your computer. Must catch some knowledge about networks, programming etc – Jacek Cz Jan 30 '17 at 21:56
  • Can you recommend any sources about these. If there is i'll be glad to know. – Alperen Adatepe Jan 30 '17 at 22:00
  • 1
    Use your computer's local IP. On Windows, type `ipconfig` in console, then look for the value after "IPv4 Address". Think of "localhost" as computer-talk for "myself". Alternatively, if your computer isn't behind a router or if you have port forwarding set up, use its public IP address (easily found using [this](https://www.whatismyip.com/)). – MikaelF Jan 30 '17 at 22:01
  • `have a site on my computer's localhost`. Nonsense. You are running a webserver on a computer. And every device, android, linux or windows, is its own localhost. So talking about localhost does not make sense in this way. – greenapps Jan 30 '17 at 22:11
  • 1
    I guess I understand what you means but my english isn't good and i don't know much about this subject.How should i say? – Alperen Adatepe Jan 30 '17 at 22:13
  • I already told you how you had to formulate that instead. – greenapps Jan 30 '17 at 22:14

2 Answers2

2

This depends on the networks your client and your server are connected to.

  • If you're using the emulator then just use your local ip address
  • If you're using a physical device on the same local network (ex: your home wifi) then use your local ip address, make sure your server is online, and make sure that there's no firewall stopping your server from listening to your requests

  • If you're using a physical device on remote network (let's say the internet) then use your remote ip address, make sure your server is online, that there's no firewall stopping it from getting local requests, configure your router to forward external requests to the computer you're using as a server (check what ip forwarding is if you're new to this)

Example with WAMP server running on Windows

1

If you want to connect an external device to your local development environment there are a few services that provide nice tunnels for you.

Some such services are:

What these services do is they connect a public address to your development environment via a temporary tunnel you can open at will. You don't have to configure your firewall, you don't have to have a public IP, and using them is generally rather easy. Give them a go, see which one works best for your needs.

Janne Enberg
  • 1,908
  • 1
  • 14
  • 12
  • 1
    `If you want to connect an external device to your local development environment`. Nobody wants that. OP wants to connect a client app on an Android device with a server application running on a computer. – greenapps Jan 30 '17 at 22:23
  • That is exactly what that means, "external device", i.e. device other than their own computer. It sounds like they have a server application running on a computer which they develop on, and they have an application running on a phone that they want to connect to that, which is exactly the case I'm talking about. – Janne Enberg Feb 01 '17 at 06:50
  • `That is exactly what that means,`. Only in your fanthasy. If you want to say what you explained now then do so right away as your original wording makes no sense. – greenapps Feb 01 '17 at 08:48
  • The original wording is perfectly fine, your failure to comprehend it does not invalidate it. – Janne Enberg Feb 01 '17 at 09:06
  • ngrok doesn't work without account creation and auth token now. localtunnel will work without any of this additional steps. – Divya Gupta Feb 20 '23 at 05:51