How to make my computer as a server so I run the application on IDE and be accessible by other computers on same network via their browsers?
If your server local ip for example is 192.168.1.20 and your web server port is 8080 then you can access your server by giving IP:PORT in the browser
eg: 192.168.1.20:8080/index.jsp
You can't make "localhost" accessible, by definition. What you can do instead is have the server process listen on an external IP address (or all addresses) instead of just on the loopback address. We can provide a more specific answer if you'll tell us how you're launching the application server.
Related
I am new to Jenkins and I have been trying to access my Jenkins server from the Internet, so that you can access it from anywhere.
I set up a no-ip DNS server to be able to bind my public ip and create a Hostname which I added Jenkins URL, but I can't access it. Do I have to add any additional configuration to Jenkins? Could someone guide me how to access it? I am really new to this.
Note: Adding port 8080 to my firewall allows me to access my localhost from any device I have on my network.
Note 2: I am using Windows 10.
You should first check if it's accessible with IP and port from the Internet. If it's not you should configure your network to allow the port and route it to the server.
Your network router has to be configured to route the incoming requests on the given port from the Internet to your server. Or your server must have a public IP assigned.
Open a windows command prompt, and execute command ipconfig to see the IP addresses assigned to the system, if you don't see your public IP here that means your system is behind a router, and without proper router configuration this system can't be accessed from the Internet.
If your system receives its IP from a router, that router must be accessible from the Internet, meaning that router should be directly connecting to the Internet, and it must have "Port Forwarding" feature through which it can be configured to forward the incoming requests to a host in its network. Or if you can connect to the Internet directly without a network router from your system it will have a publicly accessible IP address.
I'm developing a web application called myWebApp using Spring MVC, myWebApp is deployed on a remote server in the internet.
I want to use MyWebApp to communicate with a server using TCP socket via local browser and the TCP server is located in the local network.
I'm aware of the usage of Websockets but how can I send commands from web browser to the server located in the intranet network. Do you have any solution please.
Application flow is pictured below:
You can do this by some port forwarding applications that are available. But they use their own sites to access it from internet. You could try https://ngrok.com/ or similar softwares. That will give access to your locally running applications from internet.
It doesn't seem to have anything to do with websockets, or sockets. You are blocked behind NAT of the router in the intranet network. Check PORT FORWARDING configuration of your router and forward the public port that socket uses to private ip and port of the server machine.
I don't understand where is browser in your architecture. Navigator and TCP/IP server can easily talk to each other using local ip address. You spring webApp tho needs to know which server to talk to in your local network. So, public address of your local network is not enough. It needs know which local machine to connect to.
If your ip address is dynamic, use services like noip.com or buy a domain and point it to your ip address. This way by using your domain name in your application, you dont have to worry about ip address changing...
In the socket programming i am able to connect to the server socket when it is on the same pc i.e 127.0.0.1 but when my friend at a remote location runs the server program and i try to connect to it it shows the Connectiontimedout Error.
I'm giving the ip address and port number right.
Do i need to add something extra?
In order to access server remotely, your friend should bind the server to an IP address which is accessible from your machine. This will not be the case if your friend's ISP or wifi router has allocated a private IP address to him.
In such case both of you can join a Virtual Private Network to be on the same network.
Another option is port forwarding. If both of you can access a common machine then your friend can forward a port from the common machine to the application server's port to his machine. Now you can access your friends application server by accessing the socket at forwarded port on common machine.
If both of you are already on the same network then it might be possible that the server is listening on 127.0.0.1 interface only.
There are possibly other middle-boxes that do NAT (Network Address Translation) in the path between you and your friend. These normally prevent the initiation of TCP or other connections over the Internet.
Try doing the same with both of you on the same LAN (Local Area Network) or with a Hamachi VPN to simulate a LAN over the Internet.
Another possibility is configuring your router/NAT at your location to forward the port for your application to the IP address of your machine. In this case make sure to give your friend your public IP (you can get that with http://checkip.dyndns.org/).
I developed an application in my home machine. Now I want to show application that i made to client through WAN. I have TP-Link WiFi router at my home. Is it possible using port forwarding or other solution ?
Yes, you can use port forwarding to make your application accessible from the Internet. Essentially, what you want to do is redirect traffic coming into your public IP on port 80 to the internal machine running tomcat on port 8080.
There are public guides available for configuring port forwarding on different routers.
Edit: Port forwarding however might not be the only problem. There are other things to consider:
1. You should use a static external IP and map it to a DNS name, so users will be able to access the site by typing the name in the address bar.
2. You should make sure that the machine running tomcat allows external connections to port 8080, so these aren't blocked by the firewall.
To say in other words: My computer has an IP address 1.1.1.1 and the server has an IP address 2.2.2.2. My computer can access the server's IP 2.2.2.2 and work with services running on its ports (Apache, SOCKS proxy etc.). But the server can't do the same with my computer - my ISP doesn't allow it - it means when I run an Apache service on my computer on port 80, the server isn't able to call 1.1.1.1:80 (the call won't pass ISP's firewalls and reach my computer).
So, is there a way (but not contacting the ISP) to allow the server to call my IP address with successful response?
I will need some Java code to do that.
I mean creating some sort of "tunnel" which my computer opens to the server and makes the computer's IP accessible through the tunnel.