Commit abbdf92a authored by runge's avatar runge

x11vnc: add UltraVNC repeater proxy support. fix to setp gui

        mode. -threads is now strongly discouraged.  Read PORT= in url.
        User can set nolisten for Xvfb in -create mode.  clean up
        wait_for_client() to some degree.
parent d8812f8c
2008-05-07 Karl Runge <runge@karlrunge.com>
* x11vnc: add UltraVNC repeater proxy support. fix to setp gui
mode. -threads is now strongly discouraged. Read PORT= in url.
User can set nolisten for Xvfb in -create mode. clean up
wait_for_client() to some degree.
2008-01-31 Karl Runge <runge@karlrunge.com>
* x11vnc: during speeds estimate, guard against client
disconnecting. ssvnc sync.
......
This diff is collapsed.
......@@ -2149,15 +2149,95 @@ static int proxy_connect(char *host, int port) {
return psock;
}
char *get_repeater_string(char *str, int *len) {
int pren, which = 0;
int prestring_len = 0;
char *prestring = NULL, *ptmp = NULL;
char *equals = strchr(str, '=');
char *plus = strrchr(str, '+');
*len = 0;
if (!plus || !equals) {
return NULL;
}
*plus = '\0';
if (strstr(str, "repeater=") == str) {
/* ultravnc repeater http://www.uvnc.com/addons/repeater.html */
prestring_len = 250;
ptmp = (char *) calloc(prestring_len+1, 1);
snprintf(ptmp, 250, "%s", str + strlen("repeater="));
which = 1;
} else if (strstr(str, "pre=") == str) {
prestring_len = strlen(str + strlen("pre="));
ptmp = (char *) calloc(prestring_len+1, 1);
snprintf(ptmp, prestring_len+1, "%s", str + strlen("pre="));
which = 2;
} else if (sscanf(str, "pre%d=", &pren) == 1) {
if (pren > 0 && pren <= 16384) {
prestring_len = pren;
ptmp = (char *) calloc(prestring_len+1, 1);
snprintf(prestring, prestring_len, "%s", equals+1);
which = 3;
}
}
if (ptmp != NULL) {
int i, k = 0;
char *p = ptmp;
prestring = (char *)calloc(prestring_len+1, 1);
/* translate \n to newline, etc. */
for (i=0; i < prestring_len; i++) {
if (i < prestring_len-1 && *(p+i) == '\\') {
if (*(p+i+1) == 'r') {
prestring[k++] = '\r'; i++;
} else if (*(p+i+1) == 'n') {
prestring[k++] = '\n'; i++;
} else if (*(p+i+1) == 't') {
prestring[k++] = '\t'; i++;
} else if (*(p+i+1) == 'a') {
prestring[k++] = '\a'; i++;
} else if (*(p+i+1) == 'b') {
prestring[k++] = '\b'; i++;
} else if (*(p+i+1) == 'v') {
prestring[k++] = '\v'; i++;
} else if (*(p+i+1) == 'f') {
prestring[k++] = '\f'; i++;
} else if (*(p+i+1) == '\\') {
prestring[k++] = '\\'; i++;
} else if (*(p+i+1) == 'c') {
prestring[k++] = ','; i++;
} else {
prestring[k++] = *(p+i);
}
} else {
prestring[k++] = *(p+i);
}
}
if (which == 2) {
prestring_len = k;
}
if (!quiet) {
rfbLog("-connect prestring: '%s'\n", prestring);
}
free(ptmp);
}
*plus = '+';
*len = prestring_len;
return prestring;
}
/*
* Do a reverse connect for a single "host" or "host:port"
*/
extern int ssl_client_mode;
static int do_reverse_connect(char *str) {
static int do_reverse_connect(char *str_in) {
rfbClientPtr cl;
char *host, *p;
char *host, *p, *str = str_in, *s = NULL;
char *prestring = NULL;
int prestring_len = 0;
int rport = 5500, len = strlen(str);
if (len < 1) {
......@@ -2173,6 +2253,24 @@ static int do_reverse_connect(char *str) {
}
if (unixpw_in_progress) return 0;
/* look for repeater pre-string */
if (strchr(str, '=') && strrchr(str, '+')
&& (strstr(str, "pre") == str || strstr(str, "repeater=") == str)) {
prestring = get_repeater_string(str, &prestring_len);
str = strrchr(str, '+') + 1;
} else if (strrchr(str, '+') && strstr(str, "repeater://") == str) {
/* repeater://host:port+string */
/* repeater=string+host:port */
char *plus = strrchr(str, '+');
str = (char *) malloc(strlen(str_in)+1);
s = str;
*plus = '\0';
sprintf(str, "repeater=%s+%s", plus+1, str_in + strlen("repeater://"));
prestring = get_repeater_string(str, &prestring_len);
str = strrchr(str, '+') + 1;
*plus = '+';
}
/* copy in to host */
host = (char *) malloc(len+1);
if (! host) {
......@@ -2204,10 +2302,15 @@ static int do_reverse_connect(char *str) {
rfbLog("reverse_connect: failed to connect to: %s\n", str);
return 0;
}
if (prestring != NULL) {
write(vncsock, prestring, prestring_len);
free(prestring);
}
#define OPENSSL_REVERSE 4
openssl_init(1);
accept_openssl(OPENSSL_REVERSE, vncsock);
openssl_init(0);
free(host);
return 1;
}
if (use_stunnel) {
......@@ -2220,17 +2323,17 @@ static int do_reverse_connect(char *str) {
}
if (unixpw) {
int is_localhost = 0, user_disabled = 0;
int is_localhost = 0, user_disabled_it = 0;
if(!strcmp(host, "localhost") || !strcmp(host, "127.0.0.1")) {
is_localhost = 1;
}
if (getenv("UNIXPW_DISABLE_LOCALHOST")) {
user_disabled = 1;
user_disabled_it = 1;
}
if (! is_localhost) {
if (user_disabled ) {
if (user_disabled_it) {
rfbLog("reverse_connect: warning disabling localhost constraint in -unixpw\n");
} else {
rfbLog("reverse_connect: error not localhost in -unixpw\n");
......@@ -2242,6 +2345,19 @@ static int do_reverse_connect(char *str) {
if (connect_proxy != NULL) {
int sock = proxy_connect(host, rport);
if (sock >= 0) {
if (prestring != NULL) {
write(sock, prestring, prestring_len);
free(prestring);
}
cl = rfbNewClient(screen, sock);
} else {
return 0;
}
} else if (prestring != NULL) {
int sock = rfbConnectToTcpAddr(host, rport);
if (sock >= 0) {
write(sock, prestring, prestring_len);
free(prestring);
cl = rfbNewClient(screen, sock);
} else {
return 0;
......
......@@ -558,8 +558,11 @@ void do_gui(char *opts, int sleep) {
if ((q = strchr(p, '=')) != NULL) {
icon_mode_font = strdup(q+1);
}
} else if (!strcmp(p, "full")) {
;
} else if (strstr(p, "full") == p) {
if (strstr(p, "setp") && 0) {
set_env("X11VNC_ICON_MODE", "2");
set_env("X11VNC_ICON_SETPASS", "2");
}
} else if (strstr(p, "tray") == p || strstr(p, "icon") == p) {
char *q;
icon_mode = 1;
......
......@@ -429,6 +429,46 @@ void print_help(int mode) {
" Be careful about the location of this file if x11vnc\n"
" is running as root (e.g. via gdm(1), etc).\n"
"\n"
"\n"
" Repeater mode: Some services provide an intermediate\n"
" \"vnc repeater\": http://www.uvnc.com/addons/repeater.html\n"
" (and also http://koti.mbnet.fi/jtko/ for linux port)\n"
" that acts as a proxy / gateway. Modes like these require\n"
" an initial string to be sent for the reverse connection\n"
" before the VNC protocol is started. Here are the ways\n"
" to do this:\n"
"\n"
" -connect pre=some_string+host:port\n"
" -connect pre128=some_string+host:port\n"
" -connect repeater=ID:1234+host:port\n"
" -connect repeater=23.45.67.89::5501+host:port\n"
"\n"
" SSVNC notation is also supported:\n"
"\n"
" -connect repeater://host:port+ID:1234\n"
"\n"
" As with normal -connect usage, if the repeater port is\n"
" not supplied 5500 is assumed.\n"
"\n"
" The basic idea is between the special tag, e.g. \"pre=\"\n"
" and \"+\" is the pre-string to be sent. Note that in\n"
" this case host:port is the repeater server, NOT the\n"
" vnc viewer. Somehow the pre-string tells the repeater\n"
" server how to find the vnc viewer and connect you to it.\n"
"\n"
" In the case pre=some_string+host:port, \"some_string\"\n"
" is simply sent. In the case preNNN=some_string+host:port\n"
" \"some_string\" is sent in a null padded buffer of\n"
" length NNN. repeater= is the same as pre250=, this is\n"
" the ultravnc repeater buffer size.\n"
"\n"
" Strings like \"\\n\" and \"\\r\", etc. are expanded to\n"
" newline and carriage return. \"\\c\" is expanded to\n"
" \",\" since the connect string is comma separated.\n"
"\n"
" See also the -proxy option below for additional ways\n"
" to plumb reverse connections.\n"
"\n"
"-connect_or_exit str As with -connect, except if none of the reverse\n"
" connections succeed, then x11vnc shutdowns immediately.\n"
"\n"
......@@ -896,6 +936,10 @@ void print_help(int mode) {
" and so \"-ssl SAVE -redirect host:port\" can act as a\n"
" replacement for stunnel(1).\n"
"\n"
" This mode only allows one redirected connection.\n"
" The -forever option does not apply. Use -inetd or\n"
" -loop for persistant service.\n"
"\n"
"-display WAIT:... A special usage mode for the normal -display option.\n"
" Useful with -unixpw, but can be used independently\n"
" of it. If the display string begins with WAIT: then\n"
......@@ -3075,8 +3119,8 @@ void print_help(int mode) {
"-forcedpms If the system supports the DPMS (Display Power\n"
" Management Signaling) extension, then try to keep the\n"
" monitor in a powered off state. This is to prevent\n"
" nosey people at the physical display from viewing\n"
" what is on the screen. Be sure lock the screen before\n"
" nosey people at the physical display from viewing what\n"
" is on the screen. Be sure to lock the screen before\n"
" disconnecting.\n"
"\n"
" This method is far from bullet proof, e.g. suppose\n"
......@@ -3151,7 +3195,11 @@ void print_help(int mode) {
"\n"
"-threads Whether or not to use the threaded libvncserver\n"
"-nothreads algorithm [rfbRunEventLoop] if libpthread is available\n"
" Default: %s\n"
" Default: %s. NOTE: The -threads mode is now\n"
" disabled due to its unstable behavior. Not recommended,\n"
" but you can recompile with -DX11VNC_THREADED in\n"
" CPPFLAGS if you need to use it. You can also set the\n"
" env. variable X11VNC_THREADED=1\n"
"\n"
"-fs f If the fraction of changed tiles in a poll is greater\n"
" than f, the whole screen is updated. Default: %.2f\n"
......
......@@ -414,7 +414,7 @@ int verbose = 0;
/* threaded vs. non-threaded (default) */
#if LIBVNCSERVER_HAVE_LIBPTHREAD && defined(X11VNC_THREADED)
int use_threads = 1;
int use_threads = 0; /* not 1. now X11VNC_THREADED means enable it at all. */
#else
int use_threads = 0;
#endif
......
......@@ -881,7 +881,10 @@ void scale_rect(double factor, int blend, int interpolate, int Bpp,
j1 = nfix(j1, ny);
j2 = nfix(j2, ny) + 1;
/* special case integer magnification with no blending */
/*
* special case integer magnification with no blending.
* vision impaired magnification usage is interested in this case.
*/
if (mark && ! blend && mag_int && Bpp != 3) {
int jmin, jmax, imin, imax;
......@@ -1122,14 +1125,10 @@ void scale_rect(double factor, int blend, int interpolate, int Bpp,
*/
if (Bpp == 4) {
/* unroll the loops, can give 20% */
pixave[0] += w *
((unsigned char) *(src ));
pixave[1] += w *
((unsigned char) *(src+1));
pixave[2] += w *
((unsigned char) *(src+2));
pixave[3] += w *
((unsigned char) *(src+3));
pixave[0] += w * ((unsigned char) *(src ));
pixave[1] += w * ((unsigned char) *(src+1));
pixave[2] += w * ((unsigned char) *(src+2));
pixave[3] += w * ((unsigned char) *(src+3));
} else if (Bpp == 2) {
/*
* 16bpp: trickier with green
......
......@@ -1567,6 +1567,9 @@ void accept_openssl(int mode, int presock) {
if (screen->httpListenSock >= 0 && screen->httpPort > 0) {
have_httpd = 1;
}
if (screen->httpListenSock == -2) {
have_httpd = 1;
}
if (mode == OPENSSL_HTTPS && ! have_httpd) {
rfbLog("SSL: accept_openssl[%d]: no httpd socket for "
"-https mode\n", getpid());
......@@ -1695,10 +1698,11 @@ void accept_openssl(int mode, int presock) {
/* send the failure tag: */
strcpy(tbuf, uniq);
if (https_port_redir < 0) {
if (https_port_redir < 0 || (strstr(buf, "PORT=") || strstr(buf, "port="))) {
char *q = strstr(buf, "Host:");
int fport = 443;
int fport = 443, match = 0;
char num[16];
if (q && strstr(q, "\n")) {
q += strlen("Host:") + 1;
while (*q != '\n') {
......@@ -1706,12 +1710,25 @@ void accept_openssl(int mode, int presock) {
if (*q == ':' && sscanf(q, ":%d", &p) == 1) {
if (p > 0 && p < 65536) {
fport = p;
match = 1;
break;
}
}
q++;
}
}
if (!match || !https_port_redir) {
int p;
if (sscanf(buf, "PORT=%d,", &p) == 1) {
if (p > 0 && p < 65536) {
fport = p;
}
} else if (sscanf(buf, "port=%d,", &p) == 1) {
if (p > 0 && p < 65536) {
fport = p;
}
}
}
sprintf(num, "HP=%d,", fport);
strcat(tbuf, num);
}
......
......@@ -1400,32 +1400,32 @@ char create_display[] =
" else\n"
" sxcmd=$have_xinit\n"
" fi\n"
" echo \"$sxcmd $sess -- $* -nolisten tcp -auth $authfile $FD_OPTS\" 1>&2\n"
" echo \"$sxcmd $sess -- $* $nolisten -auth $authfile $FD_OPTS\" 1>&2\n"
" if [ \"X$have_root\" != \"X\" ]; then\n"
" $sxcmd $sess -- $* -nolisten tcp -auth $authfile $FD_OPTS 1>&2 &\n"
" $sxcmd $sess -- $* $nolisten -auth $authfile $FD_OPTS 1>&2 &\n"
" else\n"
" if [ \"X$ns\" = \"X0\" ]; then\n"
" $have_nohup sh -c \"$sxcmd $sess -- $* -nolisten tcp -auth $authfile $FD_OPTS\" 1>&2 &\n"
" $have_nohup sh -c \"$sxcmd $sess -- $* $nolisten -auth $authfile $FD_OPTS\" 1>&2 &\n"
" else\n"
" # Why did we ever sleep before starting the server??\n"
" $have_nohup sh -c \"(sleep $ns; $sxcmd $sess -- $* -nolisten tcp -auth $authfile $FD_OPTS)\" 1>&2 &\n"
" $have_nohup sh -c \"(sleep $ns; $sxcmd $sess -- $* $nolisten -auth $authfile $FD_OPTS)\" 1>&2 &\n"
" #result=1\n"
" fi\n"
" fi\n"
" pid=$!\n"
" else\n"
" # need to emulate startx/xinit ourselves...\n"
" echo \"$* -nolisten tcp -auth $authfile $FD_OPTS\" 1>&2\n"
" echo \"$* $nolisten -auth $authfile $FD_OPTS\" 1>&2\n"
" if [ \"X$have_root\" != \"X\" ]; then\n"
" $have_nohup $* -nolisten tcp -auth $authfile $FD_OPTS 1>&2 &\n"
" $have_nohup $* $nolisten -auth $authfile $FD_OPTS 1>&2 &\n"
" pid=$!\n"
" sleep 3\n"
" $have_nohup $sess 1>&2 &\n"
" else\n"
" if [ \"X$ns\" = \"X0\" ]; then\n"
" $have_nohup sh -c \"$* -nolisten tcp -auth $authfile $FD_OPTS\" 1>&2 &\n"
" $have_nohup sh -c \"$* $nolisten -auth $authfile $FD_OPTS\" 1>&2 &\n"
" else\n"
" $have_nohup sh -c \"(sleep $ns; $* -nolisten tcp -auth $authfile $FD_OPTS)\" 1>&2 &\n"
" $have_nohup sh -c \"(sleep $ns; $* $nolisten -auth $authfile $FD_OPTS)\" 1>&2 &\n"
" #result=1\n"
" fi\n"
" pid=$!\n"
......@@ -1719,6 +1719,8 @@ char create_display[] =
"depth=${depth:-16}\n"
"geom=${geom:-1280x1024}\n"
"\n"
"nolisten=${FD_NOLISTEN:-\"-nolisten tcp\"}\n"
"\n"
"if [ \"X$X11VNC_CREATE_GEOM\" != \"X\" -a \"X$FD_GEOM\" = \"X\" ]; then\n"
" FD_GEOM=$X11VNC_CREATE_GEOM\n"
"fi\n"
......
......@@ -671,7 +671,7 @@ of actions:
Properties - Brings up the Properties dialog to set some basic
parameters. The full tkx11vnc GUI may be accessed
via the \"Advanced ...\" button. Press \"Help ...\"
via the \"Advanced ...\" button. Press \"Help\"
in the Properties dialog for more info.
Help - Displays this help text.
......@@ -781,7 +781,7 @@ Password\" empty as well and removes the need for any password to log in.
If you set \"ViewOnly Password\" to the empty string that just removes
the ViewOnly log in aspect: \"Password\" is still required to log in.
- The \"Help ...\" button shows this help text.
- The \"Help\" button shows this help text.
- The \"Advanced ...\" button replaces the Properties dialog with the full
tkx11vnc GUI. All dynamic settings can be modified in the full GUI.
......@@ -4272,7 +4272,7 @@ proc do_props {{msg ""}} {
bind $w <KeyPress-Escape> "destroy $w"
pack $b1.apply $b1.cancel $b1.ok -side right -expand 1
pack $b1.ok $b1.cancel $b1.apply -side left -expand 0
lappend props_buttons $b1.apply $b1.cancel $b1.ok
set b2 "$w.buttons2"
......@@ -4282,12 +4282,12 @@ proc do_props {{msg ""}} {
-command "destroy $w; props_advanced" -font $bfont
if {! $icon_noadvanced} {
lappend props_buttons $b2.advanced
pack $b2.advanced -side right -expand 1
pack $b2.advanced -side left -expand 0
}
button $b2.help -text "Help ..." -command "menu_help Properties" -font $bfont
button $b2.help -text "Help" -command "menu_help Properties" -font $bfont
lappend props_buttons $b2.help
pack $b2.help -side right -expand 1
pack $b2.help -side left -expand 0
set vp "$w.viewpw"
if {$have_labelframes} {
......@@ -6626,14 +6626,8 @@ get_default_vars
dtime D
if {$icon_mode} {
if {$tray_embed} {
make_gui "tray"
} else {
make_gui "icon"
}
dtime G
old_balloon
proc check_setpasswd {} {
global icon_setpasswd
if {$icon_setpasswd} {
set m "You must specify a Session Password\n"
set m "${m}before VNC clients can connect.\n"
......@@ -6643,9 +6637,33 @@ if {$icon_mode} {
do_props $m
#push_new_value "unlock" "unlock" 1 0
}
}
if {0} {
if {[info exists env(X11VNC_ICON_SETPASS)]} {
if {$env(X11VNC_ICON_SETPASS) == "2"} {
global icon_mode_at_startup icon_mode
set icon_mode_at_startup 1
set icon_mode 2
}
}
}
if {$icon_mode} {
if {$icon_mode == 2} {
make_gui "full"
} elseif {$tray_embed} {
make_gui "tray"
} else {
make_gui "icon"
}
dtime G
old_balloon
check_setpasswd
} else {
make_gui "full"
dtime G
check_setpasswd
}
......
......@@ -682,7 +682,7 @@ char gui_code[] = "";
"\n"
" Properties - Brings up the Properties dialog to set some basic\n"
" parameters. The full tkx11vnc GUI may be accessed\n"
" via the \\\"Advanced ...\\\" button. Press \\\"Help ...\\\"\n"
" via the \\\"Advanced ...\\\" button. Press \\\"Help\\\"\n"
" in the Properties dialog for more info.\n"
" \n"
" Help - Displays this help text.\n"
......@@ -792,7 +792,7 @@ char gui_code[] = "";
"If you set \\\"ViewOnly Password\\\" to the empty string that just removes\n"
"the ViewOnly log in aspect: \\\"Password\\\" is still required to log in.\n"
"\n"
" - The \\\"Help ...\\\" button shows this help text.\n"
" - The \\\"Help\\\" button shows this help text.\n"
" \n"
" - The \\\"Advanced ...\\\" button replaces the Properties dialog with the full\n"
" tkx11vnc GUI. All dynamic settings can be modified in the full GUI.\n"
......@@ -4283,7 +4283,7 @@ char gui_code[] = "";
"\n"
" bind $w <KeyPress-Escape> \"destroy $w\"\n"
"\n"
" pack $b1.apply $b1.cancel $b1.ok -side right -expand 1\n"
" pack $b1.ok $b1.cancel $b1.apply -side left -expand 0\n"
" lappend props_buttons $b1.apply $b1.cancel $b1.ok\n"
"\n"
" set b2 \"$w.buttons2\"\n"
......@@ -4293,12 +4293,12 @@ char gui_code[] = "";
" -command \"destroy $w; props_advanced\" -font $bfont\n"
" if {! $icon_noadvanced} {\n"
" lappend props_buttons $b2.advanced\n"
" pack $b2.advanced -side right -expand 1\n"
" pack $b2.advanced -side left -expand 0\n"
" }\n"
"\n"
" button $b2.help -text \"Help ...\" -command \"menu_help Properties\" -font $bfont\n"
" button $b2.help -text \"Help\" -command \"menu_help Properties\" -font $bfont\n"
" lappend props_buttons $b2.help\n"
" pack $b2.help -side right -expand 1\n"
" pack $b2.help -side left -expand 0\n"
"\n"
" set vp \"$w.viewpw\"\n"
" if {$have_labelframes} {\n"
......@@ -6637,14 +6637,8 @@ char gui_code[] = "";
"\n"
"dtime D\n"
"\n"
"if {$icon_mode} {\n"
" if {$tray_embed} {\n"
" make_gui \"tray\"\n"
" } else {\n"
" make_gui \"icon\"\n"
" }\n"
" dtime G\n"
" old_balloon\n"
"proc check_setpasswd {} {\n"
" global icon_setpasswd\n"
" if {$icon_setpasswd} {\n"
" set m \"You must specify a Session Password\\n\" \n"
" set m \"${m}before VNC clients can connect.\\n\" \n"
......@@ -6654,9 +6648,33 @@ char gui_code[] = "";
" do_props $m\n"
" #push_new_value \"unlock\" \"unlock\" 1 0\n"
" }\n"
"}\n"
"\n"
"if {0} {\n"
" if {[info exists env(X11VNC_ICON_SETPASS)]} {\n"
" if {$env(X11VNC_ICON_SETPASS) == \"2\"} {\n"
" global icon_mode_at_startup icon_mode\n"
" set icon_mode_at_startup 1\n"
" set icon_mode 2\n"
" }\n"
" }\n"
"}\n"
"\n"
"if {$icon_mode} {\n"
" if {$icon_mode == 2} {\n"
" make_gui \"full\"\n"
" } elseif {$tray_embed} {\n"
" make_gui \"tray\"\n"
" } else {\n"
" make_gui \"icon\"\n"
" }\n"
" dtime G\n"
" old_balloon\n"
" check_setpasswd\n"
"} else {\n"
" make_gui \"full\"\n"
" dtime G\n"
" check_setpasswd\n"
"}\n"
"\n"
"\n"
......
This diff is collapsed.
.\" This file was automatically generated from x11vnc -help output.
.TH X11VNC "1" "February 2008" "x11vnc " "User Commands"
.TH X11VNC "1" "May 2008" "x11vnc " "User Commands"
.SH NAME
x11vnc - allow VNC connections to real X11 displays
version: 0.9.4, lastmod: 2008-02-17
version: 0.9.4, lastmod: 2008-05-07
.SH SYNOPSIS
.B x11vnc
[OPTION]...
......@@ -507,6 +507,45 @@ Be careful about the location of this file if x11vnc
is running as root (e.g. via
.IR gdm (1)
, etc).
.IP
Repeater mode: Some services provide an intermediate
"vnc repeater": http://www.uvnc.com/addons/repeater.html
(and also http://koti.mbnet.fi/jtko/ for linux port)
that acts as a proxy / gateway. Modes like these require
an initial string to be sent for the reverse connection
before the VNC protocol is started. Here are the ways
to do this:
.IP
\fB-connect\fR pre=some_string+host:port
\fB-connect\fR pre128=some_string+host:port
\fB-connect\fR repeater=ID:1234+host:port
\fB-connect\fR repeater=23.45.67.89::5501+host:port
.IP
SSVNC notation is also supported:
.IP
\fB-connect\fR repeater://host:port+ID:1234
.IP
As with normal \fB-connect\fR usage, if the repeater port is
not supplied 5500 is assumed.
.IP
The basic idea is between the special tag, e.g. "pre="
and "+" is the pre-string to be sent. Note that in
this case host:port is the repeater server, NOT the
vnc viewer. Somehow the pre-string tells the repeater
server how to find the vnc viewer and connect you to it.
.IP
In the case pre=some_string+host:port, "some_string"
is simply sent. In the case preNNN=some_string+host:port
"some_string" is sent in a null padded buffer of
length NNN. repeater= is the same as pre250=, this is
the ultravnc repeater buffer size.
.IP
Strings like "\\n" and "\\r", etc. are expanded to
newline and carriage return. "\\c" is expanded to
"," since the connect string is comma separated.
.IP
See also the \fB-proxy\fR option below for additional ways
to plumb reverse connections.
.PP
\fB-connect_or_exit\fR \fIstr\fR
.IP
......@@ -1068,6 +1107,10 @@ In fact, the protocol does not even need to be VNC,
and so "\fB-ssl\fR \fISAVE \fB-redirect\fR host:port\fR" can act as a
replacement for
.IR stunnel (1).
.IP
This mode only allows one redirected connection.
The \fB-forever\fR option does not apply. Use \fB-inetd\fR or
\fB-loop\fR for persistant service.
.PP
\fB-display\fR \fIWAIT:...\fR
.IP
......@@ -3620,8 +3663,8 @@ for details. \fB-nodpms\fR is basically the same as running
If the system supports the DPMS (Display Power
Management Signaling) extension, then try to keep the
monitor in a powered off state. This is to prevent
nosey people at the physical display from viewing
what is on the screen. Be sure lock the screen before
nosey people at the physical display from viewing what
is on the screen. Be sure to lock the screen before
disconnecting.
.IP
This method is far from bullet proof, e.g. suppose
......@@ -3713,7 +3756,11 @@ for this option if you don't like the 'pipe'. Example:
.IP
Whether or not to use the threaded libvncserver
algorithm [rfbRunEventLoop] if libpthread is available
Default: \fB-nothreads\fR
Default: \fB-nothreads.\fR NOTE: The \fB-threads\fR mode is now
disabled due to its unstable behavior. Not recommended,
but you can recompile with \fB-DX11VNC_THREADED\fR in
CPPFLAGS if you need to use it. You can also set the
env. variable X11VNC_THREADED=1
.PP
\fB-fs\fR \fIf\fR
.IP
......
......@@ -2589,7 +2589,7 @@ int main(int argc, char* argv[]) {
} else if (!strcmp(arg, "-connect") ||
!strcmp(arg, "-connect_or_exit")) {
CHECK_ARGC
if (strchr(argv[++i], '/')) {
if (strchr(argv[++i], '/' && !strstr(argv[i], "repeater://"))) {
client_connect_file = strdup(argv[i]);
} else {
client_connect = strdup(argv[i]);
......@@ -3280,7 +3280,22 @@ int main(int argc, char* argv[]) {
}
#if LIBVNCSERVER_HAVE_LIBPTHREAD
} else if (!strcmp(arg, "-threads")) {
#if defined(X11VNC_THREADED)
use_threads = 1;
#else
if (getenv("X11VNC_THREADED")) {
use_threads = 1;
} else {
rfbLog("\n");
rfbLog("The -threads mode is unstable and not tested or maintained.\n");
rfbLog("It is disabled in the source code. If you really need\n");
rfbLog("the feature you can reenable it at build time by setting\n");
rfbLog("-DX11VNC_THREADED in CPPFLAGS. Or set X11VNC_THREADED=1\n");
rfbLog("in your runtime environment.\n");
rfbLog("\n");
usleep(500*1000);
}
#endif
} else if (!strcmp(arg, "-nothreads")) {
use_threads = 0;
#endif
......
......@@ -15,7 +15,7 @@ int xtrap_base_event_type = 0;
int xdamage_base_event_type = 0;
/* date +'lastmod: %Y-%m-%d' */
char lastmod[] = "0.9.4 lastmod: 2008-02-17";
char lastmod[] = "0.9.4 lastmod: 2008-05-07";
/* X display info */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment