Access Jenkins from the Internet on Windows - java

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.

Related

Java run ServerSocket on PC

A common problem for a common project: I'm trying to run a ServerSocket Java program on my local PC and connect to it from an Android client. As others have experienced, things go smoothly when the client connects to the local address (eg. 192.168.xxx.xxx). If I try to connect through the internet, nothing happens:
Now, here are the things I tried:
Created inbound/outbound rules in Windows Firewall to allow traffic for the Server Port (3000)
Used the public IP in the client socket (IP obtained here)
Set up port forwarding on my router: inbound connection on port 3000 are redirected to the local IP of the server (eg. 192.1686.xxx.xxx again)
Check that the IP address of the server is listening to the port 3000 using "netstat -anp tcp".
Disabled any firewall on my router, just in case.
Still, there is no connection. Using this tool (https://www.canyouseeme.org/) I triedd checking that the port was visible (with the server app running of course), but nothing, all I get is a time out.
I'm out of options, I was hoping someone could show me what I'm missing.
Thanks.
(1) Does your PC where your server runs on have a public IP?
If you haven't applied for one and are running your code in a home or working environment, your computer only has a private IP. And considering the fact, your server and client connect well in the same LAN, the problem may be the IP.
(2)If you do have a public Ip, does your server listen on all IP address or just the LAN? Check the server bind IP is '0.0.0.0', and in ServerSocket constructor you can just set it to be null.

Getting Connectiontimedout error when creating a remote SocketServer in Java

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/).

Can I access my application running on localhost:8080 from WAN..?

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.

Java Network Connection - No Further Information Error

Alright, I have a java server setup using port 6567 and IP address 0.0.0.0 as to accept any connection. When I attempt to connect over my local network (192.168.1.15) I am able to connect just fine using the server. However when I switch to a non-local IP address (my routers public IP) I am unable to connect to it.
I have the router port forwarded and the proper rules in place on my firewall/etc. Is there any limitations on Java connecting in this fashion? I'm able to connect externally but not internally. Any thoughts on what might be causing this problem?
I'm starting to think it might be a router-specific problem, being that it could be rejecting the connection but I am unable to test that currently.
Turns out it was just the router itself that rejects internal connections using an external IP address. My personal fix was to just add a bit of testing code that automatically changes the IP if on a local machine to 127.0.0.1 rather then the external IP.
Worked flawlessly both on my own PC and having people connect externally once I set that up.
Hmm I'm not sure about it but maybe that will help.
Most probable, Your ServerSocket gets bound to a local IP address (e.g. 0.0.0.0) and ServerSocket binds to the port address there; and wouldn't respond to any requests coming from an IP address. Try new ServerSocket(4444, 50, InetAddress.getByAddress(new byte[] { YOU IP ADDRESS }).
or check again firewall
edit: Tell me how did you tried to connect from other IP than local?

How to give access to localhost:8080 on network?

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.

Categories