How to make visible my web server by android mobile - android

I have a web server running on a mac laptop. This laptop is connected to the network by my android smartphone (which receives the network by mobile operator). I would like to make visible my web server from outside, so I installed a port fowarding application on my smarthone and associated its port 8080 to the port of my laptop 80.
Then I found the IP address of my mobile device by the site http://whatismyipaddress.com/ and I tried to connect by using as URL mobile.ip:8080. The connaction failed. So could anybody tell me where I am wrong?
Thanks in advance for your help

Related

My android phone does not connect to my apache local server

I'm developing an android app that connect with a restful web service which is on my tomcat local server.
The app works well on the emulator, however, it doesn't work on my real mobile.
I use the IP from ipconfig, and both my laptop and my phone connected to the same Wi-Fi.
I tried to call the web service from the mobile browser but still, it doesn't see my localhost :(!
it shows me :
This site cannot be reached.
I searched a lot and all the solutions say that I have to connect both to the same Wi-Fi network and to use the IP from ipconfig command, which I did!
How can I fix this?
PS: I'm using 9090 as my port number, I don't know if that a reason?
Thank you.

Connect Android phone to local server

I am trying to connect my phone (android) to my local server (apache) running on Ubuntu. What I did is that I typed ifconfig in a terminal, got the local IP address of my computer and typed it on my phone's navigator. Unfortunatly my phone seems to find my server but is not able to connect to it, and times out. I have tried to disable my firewall but it didn't work either.
Do you have any idea why? How can I get my phone to connect my apache server?
Thanks in advance.
You have the ip address of your server but are you using the correct port to connect to it from your phone? Your apache server may not be setup to host on the default 80 port (check the httpd.conf file).
Also - Don't disable your firewall but you can open the port your server is hosting on (maybe port 80 by default ?). You can also use Wireshark or some packet capturing software to see if the request is making it to your server and how your server is replying.

How can I connect an android client to my XMPP (ejabberd) server, hosted on my local machine (Windows based OS)?

I want to test my ejabberd (xmpp) server, which I've hosted on my laptop, which is working on windows 10 based OS. I want to connect my android client to this server. So I went on to the internet, and found some solutions. But they seem don't work for me. This is what I've tried:
1.) Create a hotspot on a phone. Don't use data/wifi connection, as server is already on the machine.
2.) Connect the laptop to the hotspot.
3.) On cmd (running as admin), type 'ipconfig', after starting xmpp server (Obviously).
4.) Copy IPv4 address (External IP), and access web panel on the mobile browser through it.
So, I hurried toward my phone, and typed
http://[IPv4 Address]:[port open on the server for incoming connection/5280]/admin
But it(browser) throws 'Can't reach the webpage' error.
When I run
http://localhost:5280/admin
on my laptop, I could easily access my web portal, but It's unreachable on my android phone. What can I do now?
Well I solved this problem by accessing IPv4 of my laptop through my wifi router, and connecting to the port of my server through it. Initially, my browser (both of my laptop and my phone) weren't able to reach the server's port. But I later figured out it was problem in my .yml configuration file. Server wasn't set to listen all the IPv4 calls, instead it was listening to all IPv6. So I changed this, and it then become accessible to all devices on the same wifi. So it was my bad idea to connect it through the hotspot :P

Can't access to local server with Android

My problem is linked with this post : https://stackoverflow.com/questions/28982225/android-local-server-access-over-wifi/
I have a website hosted with MAMP on a Mac mini, connected to a D-Link router. I've got a Wifi-antenna (ubiquiti) which is connected to this router too, it creates a Wifi (offline) LAN.
When I try to connect to the Mac mini's IP, it displays the website from other devices (iPhone, Windows PC) but with Android it doesn't work.
I'd like to know how the developper in the link I refered did "use DNS by redirecting all domains to his custom domain".
Or if there is another way to work around this... Client devices which connects to the Wifi network shoudn't (I wish) have to configure manually their Android network parameters...
EDIT:
ngrok.io is not a solution :
clients may not have an 3G/LTE connection on their phones
the adress / IP should be the same every time the Mac reboot
Thanks in advance

Mobile device can't connect to web server in my computer

I'm developing an android application that connects to a web server to get info. I'm using HTTP Client library to connect with the web server.
I've two scenarios:
Emulator and the web server both of them installed in the same PC. The application works perfect.
Android mobile (Xperia P) connected with my PC via USB cable, and the web server installed in my PC.
In the second scenario, the application can't connect with the web server.
If I have 3G disabled, an "network unreachable" error message is received.
If I have 3G enabled, an "java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)" error message is received.
So, I would like to test my application in a real device, and the application needs to connect with the web server that is installed in my PC.
How could I do visible the web server to the android devive? I would like to have the mobile devive in the network of my PC.
Thanks
Try the following. Make sure that the phone's wifi is turned on and the phone is connected to the same network as your development machine.
Now, instead of "localhost" or "127.0.0.1" use the I.P Address of machine (assigned by DHCP for example) while calling the webservice.
Hope this helps.
Best Regards,
Anay

Categories

Resources