Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
This post was edited and submitted for review last year and failed to reopen the post:
Original close reason(s) were not resolved
Improve this question
I want to get the internet(public) ip address and use it in my java app. When I use "ipconfig" or "netstat" (shell commands) or InetAddress.getLocalHost() or even NetworkInterface.getNetworkInterfaces() the router(system) doesn't return the internet ip, instead returns the local address.
However when I connect to router config page using a browser the internet ip address is shown there.
How can I get the internet ip address in my java app?
If your router supports TR-064 there might be a chance to obtiain the public INET address assuming the vendor supports this query.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
This is probably a Network related question, although i can't really find out what is going on.
InetAddress giriAddress = java.net.InetAddress.getByName("www.google.com");
String address = giriAddress.getHostAddress();
System.out.println(address);
//output
//74.125.24.147 as well as 216.58.210.228
What i expected:
8.8.8.8
What I got:
74.125.24.147
216.58.210.228
Note:
And in fact by visiting both of these addresses I'm viewing google's homepage
My Question:
Why 8.8.8.8 is not returned? Why these two addresses looping on each other?
8.8.8.8 is the IP address of Google's DNS server.
What you're getting are the resolved IP addresses of webservers hosting www.google.com
From InetAddress#getByName:
Determines the IP address of a host, given the host's name.
So it actually does the DNS resolving for you.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
My question is how can I forward a port automatically in a server.
If anyone knows the game "Minecraft" the user have an option to create a server so anyone can join.
Now what I didn't get is how the server automatically forward the port.
Currently i do not have any code to show.
Thanks In advance.
What minecraft does is creates a local port that is listening for connections. I think what you are asking though is how does the other user get through your router to your server. The answer to that is it uses UPnP to tell your router what ports to forward from the wider Internet.
If you want to implement something similar, look for UPnP libraries for Java or whatever language you are writing in.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I have registered to the free AWS plan, and I wish to run a pure java server code I have written on this machine, so I will be able to take this server's IP and use it to connect with my client.
After some searching in AWS I have found many products and features, but I still don't understand how to perform this simple task.
Create a new EC2 Instance SSH into it, install java and prerequisites.
Ensure -
Your Security Group is opened for port 22 for external internet - 0.0.0.0/0 ( or at least your IP )
Use t2.micro instance size - only that is covered under the free tier
Remember to save / store your keypair safely
Check the below links
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-instance_linux.html
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-connect-to-instance-linux.html
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-add-volume-to-instance.html
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-clean-up-your-instance.html
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
It might be a weird question but my doubt is the following: If i need to manually forward a port to make my server listen to it, lets say port 123 so that a client can send information to it -using a random port- , lets say 321, how is the server able to respond back to that client in a way that the client receives the answer through that random port 321 if that port wasnt manually forwarded, unlike 123?
A router tracks the outgoing connection and will forward an incoming packet to the sending port when it sees a packet matching the signature.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have a web application deployed on the Jboss 4.2.1 server. I can access the application using following URL.
http://localhost:8080/myApp
But I am not able to run the application using my machines IP address like below.
http://192.168.0.100:8080/myApp
I want other developers on my network to be able to test the application deployed on my machine using my IP address.
What are the changes that I need to do in the JBoss configuration so that I can access Jboss using the IP address instead of the localhost?
You need to an extra flag while running. ./run.sh -b0.0.0.0