Data is forwarded over a local socket and SSH tunnel.
It is suitable for cases where the library does not implement a transport layer interface, only socket.
#ifdef HAVE_LIBSSH
case CParameterProxy::TYPE::SSHTunnel:
{
auto &ssh = m_pParameter->m_Proxy.m_SSH;
parameter->setServer(ssh.GetHost());
parameter->setPort(ssh.GetPort());
auto &user = ssh.m_User;
parameter->SetUser(user.GetUser());
parameter->SetUseSystemFile(user.GetUseSystemFile());
if(CParameterUser::TYPE::UserPassword == user.GetUsedType()) {
parameter->SetAuthenticationMethod(SSH_AUTH_METHOD_PASSWORD);
parameter->SetPassword(user.GetPassword());
}
if(CParameterUser::TYPE::PublicKey == user.GetUsedType()) {
parameter->SetAuthenticationMethod(SSH_AUTH_METHOD_PUBLICKEY);
parameter->SetPublicKeyFile(user.GetPublicKeyFile());
parameter->SetPrivateKeyFile(user.GetPrivateKeyFile());
parameter->SetPassphrase(user.GetPassphrase());
}
auto &net = m_pParameter->m_Net;
parameter->SetRemoteHost(net.GetHost());
parameter->SetRemotePort(net.GetPort());
if(!m_pThread)
if(!m_pThread)
return OnInitReturnValue::Fail;
bool check = connect(m_pThread, SIGNAL(
sigServer(QString, quint16)),
this, SLOT(slotConnectProxyServer(QString, quint16)));
Q_ASSERT(check);
#if defined(HAVE_UNIX_DOMAIN_SOCKET) && defined(Q_OS_UNIX)
check = connect(m_pThread, SIGNAL(
sigServer(QString)),
this, SLOT(slotConnectProxyServer(QString)));
Q_ASSERT(check);
#endif
check = connect(m_pThread, SIGNAL(sigError(int,QString)),
this, SIGNAL(sigError(int,QString)));
Q_ASSERT(check);
check = connect(m_pThread, SIGNAL(sigDisconnect()),
this, SIGNAL(sigDisconnect()));
Q_ASSERT(check);
m_pThread->start();
return OnInitReturnValue::UseOnProcess;
}
#endif
Data is forwarded over a local socket and SSH tunnel.
void sigServer(QString szHost, quint16 nPort)
It is triggered when the socket service establishes a listener and is used to notify other local sock...