" --predict=adaptive local echo for slower links [default]\n"
"-a --predict=always use local echo even on fast links\n"
"-n --predict=never never use local echo\n"
" --predict=adaptive local echo for slower links [default]\n"
"-a --predict=always use local echo even on fast links\n"
"-n --predict=never never use local echo\n"
string server = "mosh-server";
string ssh = "ssh";
string predict, port_request, ssh_port;
string server = "mosh-server";
string ssh = "ssh";
string predict, port_request, ssh_port;
static struct option long_options[] =
{
{ "client", required_argument, 0, 'c' },
{ "server", required_argument, 0, 's' },
static struct option long_options[] =
{
{ "client", required_argument, 0, 'c' },
{ "server", required_argument, 0, 's' },
{ "predict", required_argument, 0, 'r' },
{ "port", required_argument, 0, 'p' },
{ "ssh-port", required_argument, 0, 'P' },
{ "ssh", required_argument, 0, 'S' },
{ "help", no_argument, &help, 1 },
{ "version", no_argument, &version, 1 },
{ "predict", required_argument, 0, 'r' },
{ "port", required_argument, 0, 'p' },
{ "ssh-port", required_argument, 0, 'P' },
{ "ssh", required_argument, 0, 'S' },
{ "help", no_argument, &help, 1 },
{ "version", no_argument, &version, 1 },
- { "fake-proxy!", no_argument, &fake_proxy, 1 },
+ { "fake-proxy", no_argument, &fake_proxy, 1 },
- int c = getopt_long( argc, argv, "anp:P:",
+ int c = getopt_long( argc, argv, "6anp:P:",
memset( &hints, 0, sizeof( hints ) );
hints.ai_socktype = SOCK_STREAM;
memset( &hints, 0, sizeof( hints ) );
hints.ai_socktype = SOCK_STREAM;
// loop through all the results and connect to the first we can
for ( p = servinfo; p != NULL || try_family == AF_INET; p = p->ai_next ) {
if(p == NULL && try_family == AF_INET) { // start over and try AF_INET6
// loop through all the results and connect to the first we can
for ( p = servinfo; p != NULL || try_family == AF_INET; p = p->ai_next ) {
if(p == NULL && try_family == AF_INET) { // start over and try AF_INET6
if ( port_request.size() ) {
server_args.push_back( "-p" );
server_args.push_back( port_request );
if ( port_request.size() ) {
server_args.push_back( "-p" );
server_args.push_back( port_request );
string quoted_self = shell_quote_string( string( argv[0] ) );
string quoted_server_args = shell_quote( server_args );
fflush( stdout );
string quoted_self = shell_quote_string( string( argv[0] ) );
string quoted_server_args = shell_quote( server_args );
fflush( stdout );
ssh_args.push_back( "-S" );
ssh_args.push_back( "none" );
ssh_args.push_back( "-o" );
ssh_args.push_back( proxy_arg );
ssh_args.push_back( "-S" );
ssh_args.push_back( "none" );
ssh_args.push_back( "-o" );
ssh_args.push_back( proxy_arg );
ssh_args.push_back( userhost );
if ( ssh_port.size() ) {
ssh_args.push_back( "-p" );
ssh_args.push_back( ssh_port );
}
ssh_args.push_back( userhost );
if ( ssh_port.size() ) {
ssh_args.push_back( "-p" );
ssh_args.push_back( ssh_port );
}
setenv( "MOSH_KEY", key.c_str(), 1 );
setenv( "MOSH_PREDICTION_DISPLAY", predict.c_str(), 1 );
setenv( "MOSH_KEY", key.c_str(), 1 );
setenv( "MOSH_PREDICTION_DISPLAY", predict.c_str(), 1 );
execlp( client.c_str(), client.c_str(), ip.c_str(), port.c_str(), (char *)NULL );
}
execlp( client.c_str(), client.c_str(), ip.c_str(), port.c_str(), (char *)NULL );
}