Class Connection
java.lang.Object
de.iip_ecosphere.platform.deviceMgt.ssh.Connection
- All Implemented Interfaces:
Runnable
Creates a connection between a remote and a client socket with the help
of two instances of
Proxy. Its connecting them by configure one proxy
to proxy the client to the server and the other proxy to proxy the server to
the client.
Main parts were acquired from https://github.com/oksuz/tcp-proxy (MIT)- Author:
- oksuz, Github on 29/10/2017.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConnection(Socket clientSocket, String remoteIp, int remotePort) Sets up a connection between a client and a remote. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidClose the server Connection.voidrun()Runs the connection, should be run in combination with a thread.
-
Field Details
-
LOGGER
private static final de.iip_ecosphere.platform.support.logging.Logger LOGGER -
clientSocket
-
remoteIp
-
remotePort
private final int remotePort -
serverConnection
-
clientServerThread
-
serverClientThread
-
-
Constructor Details
-
Connection
Sets up a connection between a client and a remote.- Parameters:
clientSocket- the client socketremoteIp- the remote ip addressremotePort- the remote port
-
-
Method Details
-
run
public void run()Runs the connection, should be run in combination with a thread. This method also checks if the connection is still up. After the client disconnects, the connection is closed. -
closeServerConnection
private void closeServerConnection()Close the server Connection.
-