Find LAN Connection behind VPN using signed java applet? - java

I am able to run ipconfig /all on the client machine using signed java applet, how to find LAN Connection ip which initiated VPN Connection on client machine as there can be multiple LAN,WI-FI, Virtual connections ?

You cannot do such things with the standard Java API. You will have to connect to native code (either the command line or some C/C++ library using JNI) from your Java code.

Related

How to connect to a server that may be on the network/the current computer

I may be using my Java program (which is initialized by the simple Batch code at the bottom, which may or may not help anything). From my main computer which will connect to localhost to get to my MySql server.
I otherwise could be connecting via a laptop, which is on the same Wi-Fi network. Therefore, I believe it would use the IPv4 address. Lastly, I could connect via a completely different network and would use my IP.
How could I use Java to detect where exactly it is and change which host it will connect to while pinging the server?
java -jar thb.jar
pause

How do you establish a connection to a server in Java?

I want to create an application which will connect to a file server and download a few video files. The server is a shared hosting Linux server.
I don't want code or anything like that, I just want to know whether this is possible and if so, what should I be researching. Should I be using java sockets? Or can Java sockets only connect to java based servers?
Should I be using java sockets?
Depends on the type of server you connect to. You can use an existing library which will abstract the interaction with the server for you (recommended) or implement the required protocol yourself (not recommended).
Can Java sockets only connect to java based servers?
Sockets in Java are just an interface to the native socket API of the OS you are on. Every program that connects to a server over the network has to use them, regardless of whether it is a C/C++/Python/Java/... application. So, to answer your question; no, "Java sockets" can connect to any server.
Read more about sockets in this Wikipedia article about sockets in general or this one about Berkeley sockets (the socket API implemented by most operating systems).

Start a java application from a remote computer using ssh protocol

I want to start my java app remotely. I'd like to use the SSH protocol as a way to communicate. Is there a library that will help do this?
SSH client and server in java
But I would use just ssh support built in the system, so you connect to the box with ssh and then just use terminal to access command-line console of your java app.

Opening Notepad on remote system using RMI

I am trying to use RMI to open notepad in the remote system.
Is it possible to do that using RMI??
Or do I have to use SSH ??
Comparing RMI with SSH is a bit like comparing apples with oranges. RMI is more of a general purpose API for performing requests over the network, while SSH is a program used to establish a secure shell connection over which you can send shell commands.
To open Notepad on a remote host, you can use either RMI or SSH since both are capable of communicating over the network.
In either case, you'll need a server on the receiving end, that handles your commands and opens Notepad for you. If you use SSH, this will be readily available to you, in the form of an sshd daemon. In case you go for RMI I don't know of any predefined server implementation. I would recommend you to write up your own server serving your particular requests.

Testing a client/server Java application on a virtual machine using VirtualBox

I'm testing a client-server based Java application where a specific scenario involves having both the client and server running on the same host (i.e., the client connects to the server running on localhost). This seems to work fine except for when I test this scenario on a virtual machine (running 32bit Windows 7) using VirtualBox.
Note: Everything henceforth is running inside the virtual machine. I start the server and try to connect to it using the client but the connection times out. Surprisingly, I tried connecting to the server using putty and the connection behaved as expected. Both the Java client and putty tried to connect to localhost - the client failed but putty succeeded.
Does anyone have a possible explanation for why this might be happening?
Note: This is not a duplicate of Addressing localhost from a virtualbox virtual machine
How do you connect to the localhost? By connecting to the hostname "localhost"? You could try connecting to the InetAddress returned by getLocalHost()

Categories