I am using an android device as a web server. Everything works good in localhost, but i want it to be published. My device connects to internet through wifi, not 3G.
(device)--->(wifi router)--->(modem). I tried to foward the port but it didn't work. Seem like my device's ip was provided by the router, not the modem, therefore the modem cannot "see" it. Can you help me to do this? I want my server to be published.
Related
I am using the NanoHttpd library to set up a server. It is currently serving a 'Hello World' HTML page.
It is accessible from the browser of the phone on which it is deployed but not on other phones or laptops on the same WiFi.
For example, http://10.54.92.228:8080 is accessible to the browser of the phone on which the server is deployed. But, is inaccessible to other devices over the network. Is there any way to enable incoming connections ?
I am working on a similar project, I have to host files over WIFI on an android device which is accessible to anyone on the same WIFI network.
The web server is working as I want.
I think the problem is with your IP-Address of the server.
For a WIFI network, the network should be in the range of 192.168.137.XXX.
What you are inputting is the global ip of the device on which your server is.
Check you local ip, and enter it with the port number and it will work.
Ping me if you need any help.
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
I am programming an Android app which connects to a TCP server running on my computer using sockets. This works perfectly fine as long as both my computer and my smartphone are connected to the Wi-Fi of my router.
I want it to also work when my computer and my phone are not connected to the Wi-Fi. Therefore I configured a Wi-Fi hotspot using hosted network on my computer. My smartphone recognizes the Wi-Fi and is able to connect to it. But now my app can't connect to the server running on my PC although I changed the code to the new IP that I got by using ipconfig on my PC.
I downloaded an app named "Fing" from the Google play store. The app shows all devices in a network. It does show my computer under the right IP address. I don't understand why my app can't connect to the server running on the PC.
On the one hand, I don't think that the problem is in the app's code, because it works on the router's Wi-Fi network. On the other hand, I doesn't seem to be a setup mistake either, because Fing is detecting my PC.
Do you have any ideas what the problem might be, or any other solution for my needs?
I actually wrote the TCP server myself using c#. I configured the Server to listen to all of my computers networkinterfaces usingIPAdress.IPv6Any. I also did configure it as dual mode socket so it can accept ipv4 and ipv6 connections. I will post the code when i am back home. So the TCP server also looks ok to me.
I need to send an image file from the mobile to the server(where the server will save it to the hard disk). I have wrote both the android mobile part and the server side. I need to test the code before deploying to the server. Will the code work if I connect the mobile to the WI-Fi network through which I can have a LAN connection to the system? Is there any way I can test the code with out using a WI-Fi connection(ie Connecting phone to the system via the usb cable and then forming a LAN or something)? Please voice your valuable opinion in these stuff.
When I was testing my server-side I didn't find any other way rather than connecting via wifi, this way it was working just fine (in your code you need to use ipv4, not localhost, just as reminder). I'm not good with network stuff, but I don't think it's possible using usb to create some kind of LAN.
Have u tried from emulator? How to connect to my http://localhost web server from Android Emulator in Eclipse
I'm developing an app for android that consumes a .NET webservice. This part is ok, I've already tested in the vm and my app does call the webservice and do what its supposed to do.
The problem is that i need to test it "live" now. As my app needs bluetooth and other stuff that the emulator can't provide I have to deploy it in my phone and try out.
The real problem is that my webservice is hosted in my computer (not in IIS). How can i connect to the webservice?
I've already set a VPN connection in my computer so that i could be in the same network. The connection was ok and i could ping my computer from my android phone (i downloaded an app for that). But i tried to call the webservice using my computer's ip and it doesn't work.
I use this address on browser: http://192.168.56.1:49365/DataUpload.asmx (where 192.168.56.1 is the ip from my computer and DataUpload.asmx is the name of the webservice)
The name of the webservice is ok and the ip too but i can't see the webservice.
Does anyone knows how to help me? I suppose is something with the port or something like that (MY FIREWALL IS DISABLED).
Thanks in advance.
Almost certainly 192.168.56.1 is your router, this is pretty much the norm. To be sure, go to your computer and use the same address in your browser there as you tried on the phone.
Post your results.
One other thing, you'll have to turn off the 'Cellular' radio in your phone to be sure it only connects via WiFi. Otherwise you'll have to find out what IP address you have at your house and point your phone at that IP and port forward from your router to your local machine.