This question already has answers here:
How can I access my localhost from my Android device?
(44 answers)
Closed 6 years ago.
I have a pretty dumb question.
I have a Java server running on my computer, which can be visited on localhost:8080. How do I visit it through my mobile phone (in local network, connected to Wi-Fi)?
I tried to open the port or even turn off the firewall.
The path Ip address:port doesn't seem to work.
Is there something I am missing or forgot to do?
its running on your local machine not on your local network/wifi, what you'll have to do is find your computer IP and use it with the current port if you are on the same network.
in general its bad practice to test server programs like that and its highly recommended to use an Apache server and upload it to a cloud then just run it from there.
Related
This question already has answers here:
How can I deploy and execute an application on a device connected to a remote system?
(4 answers)
Closed 4 years ago.
There's an app my team is developing in Android Java using Android Studio.
The app works alright on all our test devices, however it shows some bugs on the client's device.
Is it possible to somehow connect the client's device to his network and make this device available on a developer machine for debugging over the internet?
It was pointed to me that this answer already answers my question. I agree that it does in part; it teaches how to connect the client adb to the adb server on a remote network. Still, can I use Android Studio to debug the phone?
Maybe VPN can be used? I don't know much about VPNs, so suggestions of which would work would be awesome.
Thank you.
This is pretty dangerous, as exposing the debugging bridge of your personal device to the internet could prove problematic and unsafe for your personal data.
That aside, the only way I could see this working would be if the client were to port forward the debugging port to the IP address of their device (this would need to be completed on their router)
By default I believe the port to be 5037.
Once the port is forwarded, you should be able to connect to that device in particular by using
adb connect <their external IP>
Again, I cannot stress enough how dangerous this could potentially be.
This question already has answers here:
Sockets: Discover port availability using Java
(10 answers)
Closed 4 years ago.
Is it even possible to check if port is open and reachable to others?
Right now I'm using to check if my listener is reachable by using canyouseeme.org by simply entering port number.
What I want to know is it possible to make my application to detect if port is reachable to others, not using local ip.
Yes of course, you can use a library like NETTY or you can check previously answered topic
Sockets: Discover port availability using Java
This question already has answers here:
RMI cannot connect to remote server
(2 answers)
Closed 9 years ago.
I can't seem to connect 2 machines using RMI. To make sure there wasn't something wrong with my code I copied the simple example from wikipedia (http://en.wikipedia.org/wiki/Java_remote_method_invocation) and I edited the code to print out a simple int.
I tried giving all permissions and turning all the firewalls off and I still get this error:
java.rmi.ConnectException: Connection refused to host 55.229.xx.xxx; nested
exception is:java.net.ConnectException: Connection timed out: connect
I've been trying to do this for the past 3 days and I still can't seem to get past basic configuration problems.
The Problem could be your RMI server is sending back its local address, instead of WAN address.
System.setProperty("java.rmi.server.hostname", *host IP*);
also take a look at security policies regarding RMI:
http://docs.oracle.com/javase/tutorial/rmi/running.html
Check your firewall settings on your aws instance
RMI is running on 1099 port by default as i remember.
This question already has answers here:
Connecting to a VPN without installation of client software
(3 answers)
Closed 8 years ago.
I am trying to write a client-server program in Java. There are a lot of working examples with using localhost as IP of the server. I am using VPN and running client and server codes on different computers in same network. But client can not connect to this server when I provide ip given after running VPN (such as 12.123.45.32). I generally get timeout error even if I set it to a large number. But if I use local IP such as 192.168.1.10, it works and connects.
I also wonder if there is a way for client and server to communicate with using server's public IP (without any VPN).
Any suggestions?
Thanks..
There is no problem in accessing a server through public ip or domain name. Only problem can be address renewal. Other than that you need to make sure the correct ports are forwarded in your router / firewall.
Are you using sockets or RMI?
Sockets shouldn't be a problem, but RMI require you to setup a SecurityManager or something like that. Honestly I have never gotten RMI to work over internet; I have stuck with sockets.
I wouldn't bother with VPN at all. Way too unstable imho. I only use VPN if I'm unable to setup company router for access.
This question already has answers here:
How to get the list of IP addresses in a LAN?
(2 answers)
Closed 9 years ago.
Recently, I created a client/server application by java, they connect is fine, but when i test it in my school network, it can not work fine anymore, so, i need some code that return all IP of Lan network into an array so that i can put it in a JComboBox, the code should be non-blocking so it cannot hang my application.
P/S: I have been try brute-force method (like other answer) to get all IPs but it just hang my application and really not reliable.
Anyway, thank for your help.
~Best Regard and have a nice day
it can not work fine anymore, so, i need some code that return all IP
of Lan network into an array so that i can put it in a JComboBox
Why would you need these IPs????
Problem could be:
Either you bind to localhost and when you deploy in different machines you can't connect. So don't bind to localhost.
Or there is a firewall. So unblock the firewall.
Or there is no route between the machines. Can you even ping it? (but if there is a firewall it will not ping also).
So you can troubleshoot it.