configureServer ();
}
private void start () throws IOException {
SshServer server = new SshServer() {
@Override
public void configureServices (ConnectionProtocol connection) throws IOException {
connection.addChannelFactory(SessionChannelFactory.SESSION_CHANNEL,
new SessionChannelFactory());
if (ConfigurationLoader.isConfigurationAvailable(ServerConfiguration.class)) {
if ((ConfigurationLoader
.getConfiguration(com.sshtools.daemon.configuration.ServerConfiguration.class)).getAllowTcpForwarding()) {
// ForwardingServer forwarding =
new ForwardingServer(connection);
}
}
}
@Override
public void shutdown (String msg) {
// Disconnect all sessions
}
@Override
protected boolean isAcceptConnectionFrom(Socket socket) {
return true;
}
};
server.startServer();
}