mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-04 12:49:28 -04:00
Added SSHv2 connections to retroshare-nogui.
* Using libssh in a seperate thread. * Binds to fixed port, and accepts connections from standard SSH clients. * Only an Echo Server at the moment: Interface to be decided yet. * Only accepts 1 connection, 2nd connection hangs at the moment. * A long way to go before it will be useful! git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5380 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
f710dba2c6
commit
b8729de06a
4 changed files with 653 additions and 0 deletions
|
@ -40,6 +40,10 @@
|
|||
#include "introserver.h"
|
||||
#endif
|
||||
|
||||
#ifdef RS_SSH_SERVER
|
||||
#include "ssh/rssshd.h"
|
||||
#endif
|
||||
|
||||
/* Basic instructions for running libretroshare as background thread.
|
||||
* ******************************************************************* *
|
||||
* This allows your program to communicate with authenticated peers.
|
||||
|
@ -132,6 +136,13 @@ int main(int argc, char **argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
#ifdef RS_SSH_SERVER
|
||||
// Says it must be called before all the threads are launched! */
|
||||
// NB: this port number is not currently used.
|
||||
RsSshd *ssh = RsSshd::InitRsSshd(22, "rs_ssh_host_rsa_key");
|
||||
ssh->adduser("anrsuser", "test");
|
||||
#endif
|
||||
|
||||
/* Start-up libretroshare server threads */
|
||||
rsServer -> StartupRetroShare();
|
||||
|
||||
|
@ -139,6 +150,10 @@ int main(int argc, char **argv)
|
|||
RsIntroServer rsIS;
|
||||
#endif
|
||||
|
||||
#ifdef RS_SSH_SERVER
|
||||
ssh->start();
|
||||
#endif
|
||||
|
||||
/* pass control to the GUI */
|
||||
while(1)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue