ssvnc/enhanced_tightvnc_viewer update.

pull/1/head
runge 15 years ago
parent 09f63f0395
commit a8453eea8b

@ -64,19 +64,29 @@ The enhanced TightVNC viewer features are:
- Ability to Save and Load VNC profiles for different hosts.
- You can also use your own VNC Viewer, e.g. UltraVNC or RealVNC,
with the front-end GUI or scripts if you like.
- Create or Import SSL Certificates and Private Keys.
- Reverse (viewer listening) VNC connections via SSL and SSH.
- VeNCrypt SSL/TLS VNC encryption support (used by VeNCrypt,
QEMU, ggi, libvirt/virt-manager/xen, vinagre/gvncviewer/gtk-vnc)
- ANONTLS SSL/TLS VNC encryption support (used by Vino)
- VeNCrypt and ANONTLS are also enabled for any 3rd party VNC
Viewer (e.g. RealVNC, TightVNC, UltraVNC ...) on Unix, MacOSX,
and Windows via the provided SSVNC VeNCrypt Viewer Bridge tool
(use 'Change VNC Viewer' to select the one you want.)
- Support for Web Proxies, SOCKS Proxies, and the UltraVNC
repeater proxy (e.g. repeater://host:port+ID:1234). Multiple
proxies may be chained together (3 max).
- Support for SSH Gateway connections and non-standard SSH ports.
- You can also use your own VNC Viewer, e.g. UltraVNC or RealVNC,
with the front-end GUI or scripts if you like.
- Automatic Service tunnelling via SSH for CUPS and SMB Printing,
ESD/ARTSD Audio, and SMB (Windows/Samba) filesystem mounting.
@ -131,11 +141,6 @@ The enhanced TightVNC viewer features are:
- Option "-unixpw ..." for use with "x11vnc -unixpw" login dialogs.
- VeNCrypt SSL/TLS VNC encryption support (used by VeNCrypt,
QEMU, ggi, libvirt/virt-manager/xen, vinagre/gvncviewer/gtk-vnc)
- ANONTLS SSL/TLS VNC encryption support (used by vino)
- Support for UltraVNC extensions: Single Window, Disable
Server-side Input, 1/n Server side scaling, Text Chat (shell
terminal UI). Both UltraVNC and x11vnc servers support these
@ -152,12 +157,13 @@ The enhanced TightVNC viewer features are:
SC I, and SSL encrypted: SC III)
- Support for UltraVNC DSM Encryption Plugin mode. (ARC4 and
AESV2, and MSRC4)
AESV2, MSRC4, and SecureVNC)
- Support for UltraVNC MS-Logon authentication (NOTE: the UltraVNC
MS-Logon key exchange implementation is very weak; an eavesdropper
on the network can recover your Windows password easily; you
need to use an additional encrypted tunnel with MS-Logon.)
- Support for UltraVNC MS-Logon authentication (NOTE: the
UltraVNC MS-Logon key exchange implementation is very weak; an
eavesdropper on the network can recover your Windows password
easily in a few seconds; you need to use an additional encrypted
tunnel with MS-Logon.)
- Support for symmetric encryption (including blowfish and 3des
ciphers) to Non-UltraVNC Servers. Any server using the same
@ -173,6 +179,11 @@ The enhanced TightVNC viewer features are:
long periods of time a listening port on the the local (VNC
viewer) side that redirects to the remote side.
- Reverse (viewer listening) VNC connections can show a
Popup dialog asking whether to accept the connection or not
(-acceptpopup.) The extra info provided by UltraVNC Single Click
reverse connections is also supported (-acceptpopupsc)
- Extremely low color modes: 64 and 8 colors in 8bpp
(-use64/-bgr222, -use8/-bgr111)
@ -244,7 +255,7 @@ Unix and Mac OS X:
Unpack the archive:
% gzip -dc ssvnc-1.0.24.tar.gz | tar xvf -
% gzip -dc ssvnc-1.0.25.tar.gz | tar xvf -
Run the GUI:
@ -252,7 +263,7 @@ Unix and Mac OS X:
% ./ssvnc/MacOSX/ssvnc (for Mac OS X)
The smaller file "ssvnc_no_windows-1.0.24.tar.gz"
The smaller file "ssvnc_no_windows-1.0.25.tar.gz"
could have been used as well.
On MacOSX you could also click on the SSVNC app icon in the Finder.
@ -298,8 +309,8 @@ Unix/MacOSX Install:
For the conventional source tarball it will compile and install, e.g.:
gzip -dc ssvnc-1.0.24.src.tar.gz | tar xvf -
cd ssvnc-1.0.24
gzip -dc ssvnc-1.0.25.src.tar.gz | tar xvf -
cd ssvnc-1.0.25
make config
make all
make PREFIX=/my/install/dir install
@ -311,7 +322,7 @@ Windows:
Unzip, using WinZip or a similar utility, the zip file:
ssvnc-1.0.24.zip
ssvnc-1.0.25.zip
Run the GUI, e.g.:
@ -323,7 +334,7 @@ Windows:
select Open, and then OK to launch it.
The smaller file "ssvnc_windows_only-1.0.24.zip"
The smaller file "ssvnc_windows_only-1.0.25.zip"
could have been used as well.
You can make a Windows shortcut to this program if you want to.

@ -11,15 +11,17 @@ proc check_callback {} {
proc getout {} {
global client_fh server_fh
set delay 50
catch {flush $client_fh}
after $delay
catch {close $client_fh}
set client_fh ""
after $delay
catch {flush $server_fh}
after $delay
catch {close $server_fh}
set server_fh ""
after $delay
global bmesg_cnt
@ -37,54 +39,78 @@ proc check_closed {} {
if {! $got_connection} {
return
}
if {$client_fh != "" && [eof $client_fh]} {
if {$debug} {
puts stderr "client_fh EOF"
if {$client_fh != ""} {
set ef ""
catch {set ef [eof $client_fh]}
if {$ef == 1} {
if {$debug} {
puts stderr "client_fh EOF"
}
getout
}
getout
}
if {$server_fh != "" && [eof $server_fh]} {
if {$debug} {
puts stderr "server_fh EOF"
if {$server_fh != ""} {
set ef ""
catch {set ef [eof $server_fh]}
if {$ef == 1} {
if {$debug} {
puts stderr "server_fh EOF"
}
getout
}
getout
}
}
proc xfer_in_to_out {} {
global client_fh server_fh debug
global client_fh server_fh debug do_bridge
if {$client_fh != "" && ![eof $client_fh]} {
set str ""
catch {set str [read $client_fh 4096]}
if {$debug} {
puts stderr "xfer_in_to_out: $str"
}
if {$server_fh != "" && $str != ""} {
puts -nonewline $server_fh $str
flush $server_fh
set ef ""
catch {set ef [eof $client_fh]}
if {$ef == 0} {
set str ""
catch {set str [read $client_fh 4096]}
if {$debug} {
#puts stderr "xfer_in_to_out: $str"
puts stderr "xfer_in_to_out: [string length $str]"
}
if {$server_fh != "" && $str != ""} {
catch {puts -nonewline $server_fh $str}
catch {flush $server_fh}
}
}
}
check_closed
}
proc xfer_out_to_in {} {
global client_fh server_fh debug
if {$server_fh != "" && ![eof $server_fh]} {
set str ""
catch {set str [read $server_fh 4096]}
if {$debug} {
puts stderr "xfer_out_to_in: $str"
}
if {$client_fh != "" && $str != ""} {
puts -nonewline $client_fh $str
flush $client_fh
global client_fh server_fh debug do_bridge
if {$server_fh != ""} {
set ef ""
catch {set ef [eof $server_fh]}
if {$ef == 0} {
set str ""
catch {set str [read $server_fh 4096]}
if {$debug} {
#puts stderr "xfer_out_to_in: $str"
puts stderr "xfer_out_to_in: [string length $str]"
}
if {$client_fh != "" && $str != ""} {
catch {puts -nonewline $client_fh $str}
catch {flush $client_fh}
}
}
}
check_closed
}
proc bmesg {msg} {
return
global env
if {! [info exists env(BMESG)]} {
return
}
if {$env(BMESG) == 0} {
return
}
global bmesg_cnt
if {! [info exists bmesg_cnt]} {
@ -380,6 +406,560 @@ proc do_connect_repeater {sock hostport which repeater} {
}
}
proc vread {n sock} {
set str ""
set max 3000
set dt 10
set i 0
set cnt 0
while {$cnt < $max && $i < $n} {
incr cnt
set c [read $sock 1]
if {$c == ""} {
check_closed
after $dt
continue
}
incr i
append str $c
}
if {$i != $n} {
puts stderr "vread failure $n $i"
destroy .; exit 1
}
return $str
}
proc append_handshake {str} {
global env
if [info exists env(SSVNC_PREDIGESTED_HANDSHAKE)] {
set file $env(SSVNC_PREDIGESTED_HANDSHAKE)
set fh ""
catch {set fh [open $file a]}
if {$fh != ""} {
puts $fh $str
catch {close $fh}
}
}
}
proc vencrypt_bridge_connection {fh host port} {
puts stderr "vencrypt_bridge_connection: got connection $fh $host $port"
bmesg "vencrypt_bridge_connection: got connection $fh $host $port"
global viewer_sock
set viewer_sock $fh
}
proc center_win {w} {
update
set W [winfo screenwidth $w]
set W [expr $W + 1]
wm geometry $w +$W+0
update
set x [expr [winfo screenwidth $w]/2 - [winfo width $w]/2]
set y [expr [winfo screenheight $w]/2 - [winfo height $w]/2]
wm geometry $w +$x+$y
wm deiconify $w
update
}
proc get_user_pass {} {
global env
set up ""
if [info exists env(SSVNC_UNIXPW)] {
set rm 0
set up $env(SSVNC_UNIXPW)
if [regexp {^rm:} $up] {
set rm 1
regsub {^rm:} $up "" up
}
if [file exists $up] {
set fh ""
set f $up
catch {set fh [open $up r]}
if {$fh != ""} {
gets $fh u
gets $fh p
catch {close $fh}
set up "$u@$p"
}
if {$rm} {
catch {file delete $f}
}
}
} elseif [info exists env(SSVNC_VENCRYPT_USERPASS)] {
set up $env(SSVNC_VENCRYPT_USERPASS)
}
if {$up != ""} {
return $up
}
toplevel .t
wm title .t {VeNCrypt Viewer Bridge User/Pass}
global user pass
set user ""
set pass ""
label .t.l -text {SSVNC VeNCrypt Viewer Bridge}
frame .t.f0
frame .t.f0.fL
label .t.f0.fL.la -text {Username: }
label .t.f0.fL.lb -text {Password: }
pack .t.f0.fL.la .t.f0.fL.lb -side top
frame .t.f0.fR
entry .t.f0.fR.ea -width 24 -textvariable user
entry .t.f0.fR.eb -width 24 -textvariable pass -show *
pack .t.f0.fR.ea .t.f0.fR.eb -side top -fill x
pack .t.f0.fL -side left
pack .t.f0.fR -side right -expand 1 -fill x
button .t.no -text Cancel -command {set user ""; set pass ""; destroy .t}
button .t.ok -text Done -command {destroy .t}
center_win .t
pack .t.l .t.f0 .t.no .t.ok -side top -fill x
update
wm deiconify .t
bind .t.f0.fR.ea <Return> {focus .t.f0.fR.eb}
bind .t.f0.fR.eb <Return> {destroy .t}
focus .t.f0.fR.ea
wm resizable .t 1 0
wm minsize .t [winfo reqwidth .t] [winfo reqheight .t]
tkwait window .t
if {$user == "" || $pass == ""} {
return ""
} else {
return "$user@$pass"
}
}
proc do_vencrypt_viewer_bridge {listen connect} {
global env
#set env(BMESG) 1
vencrypt_constants
set backwards 0
if {! [info exists env(SSVNC_PREDIGESTED_HANDSHAKE)]} {
puts stderr "no SSVNC_PREDIGESTED_HANDSHAKE filename in environment."
destroy .; exit 1
}
set handshake $env(SSVNC_PREDIGESTED_HANDSHAKE)
bmesg $handshake
if {$listen < 0} {
set backwards 1
set listen [expr -$listen]
}
# listen on $listen
global viewer_sock
set viewer_sock ""
set lsock ""
set rc [catch {set lsock [socket -myaddr 127.0.0.1 -server vencrypt_bridge_connection $listen]}]
if {$rc != 0} {
puts stderr "error listening on 127.0.0.1:$listen"
destroy .; exit 1
}
bmesg "listen on $listen OK"
# accept
vwait viewer_sock
catch {close $lsock}
fconfigure $viewer_sock -translation binary -blocking 0
global got_connection
set got_connection 1
# connect to $connect
set server_sock ""
set rc [catch {set server_sock [socket 127.0.0.1 $connect]}]
if {$rc != 0} {
puts stderr "error connecting to 127.0.0.1:$connect"
destroy .; exit 1
}
bmesg "made connection to $connect"
fconfigure $server_sock -translation binary -blocking 0
if {$backwards} {
puts stderr "reversing roles of viewer and server"
set t $viewer_sock
set viewer_sock $server_sock
set server_sock $t
}
# wait for SSVNC_PREDIGESTED_HANDSHAKE "done", put in hash.
set dt 200
set slept 0
set maxwait 20000
set hs(mode) init
while {$slept < $maxwait} {
after $dt
set slept [expr $slept + $dt]
set done 0
set fh ""
catch {set fh [open $handshake r]}
set str ""
if {$fh != ""} {
array unset hs
while {[gets $fh line] > -1} {
set line [string trim $line]
set str "$str$line\n";
if {$line == "done"} {
set done 1
} elseif [regexp {=} $line] {
set s [split $line "="]
set key [lindex $s 0]
set val [lindex $s 1]
set hs($key) $val
}
}
catch {close $fh}
}
if {$done} {
puts stderr $str
bmesg "$str"
break
}
}
catch [file delete $handshake]
if {! [info exists hs(sectype)]} {
puts stderr "no hs(sectype) found"
destroy .; exit 1
}
# read viewer RFB
if {! [info exists hs(server)]} {
set hs(server) "RFB 003.008"
}
puts -nonewline $viewer_sock "$hs(server)\n"
flush $viewer_sock
puts stderr "sent $hs(server) to viewer sock."
set viewer_rfb [vread 12 $viewer_sock]
puts stderr "read viewer_rfb $viewer_rfb"
set viewer_major 3
set viewer_minor 8
if [regexp {^RFB 003\.0*([0-9][0-9]*)} $viewer_rfb m v] {
set viewer_minor $v
}
if {$hs(sectype) == $rfbSecTypeAnonTls} {
puts stderr "handling rfbSecTypeAnonTls"
if {$viewer_major > 3 || $viewer_minor >= 7} {
puts stderr "viewer >= 3.7, nothing to set up."
} else {
puts stderr "viewer <= 3.3, faking things up."
set t [vread 1 $server_sock]
binary scan $t c nsectypes
puts stderr "nsectypes=$nsectypes"
for {set i 0} {$i < $nsectypes} {incr i} {
set t [vread 1 $server_sock]
binary scan $t c st
puts stderr " $i: $st"
set types($st) $i
}
set use 1
if [info exists types(1)] {
set use 1
} elseif [info exists types(2)] {
set use 2
} else {
puts stderr "no valid sectypes"
destroy .; exit 1
}
# this should be MSB:
vsend_uchar $viewer_sock 0
vsend_uchar $viewer_sock 0
vsend_uchar $viewer_sock 0
vsend_uchar $viewer_sock $use
vsend_uchar $server_sock $use
if {$use == 1} {
set t [vread 4 $server_sock]
}
}
} elseif {$hs(sectype) == $rfbSecTypeVencrypt} {
puts stderr "handling rfbSecTypeVencrypt"
if {! [info exists hs(subtype)]} {
puts stderr "no subtype"
destroy .; exit 1
}
set fake_type "None"
set plain 0
set sub_type $hs(subtype)
if {$sub_type == $rfbVencryptTlsNone} {
set fake_type "None"
} elseif {$sub_type == $rfbVencryptTlsVnc} {
set fake_type "VncAuth"
} elseif {$sub_type == $rfbVencryptTlsPlain} {
set fake_type "None"
set plain 1
} elseif {$sub_type == $rfbVencryptX509None} {
set fake_type "None"
} elseif {$sub_type == $rfbVencryptX509Vnc} {
set fake_type "VncAuth"
} elseif {$sub_type == $rfbVencryptX509Plain} {
set fake_type "None"
set plain 1
}
if {$plain} {
set up [get_user_pass]
if [regexp {@} $up] {
set user $up
set pass $up
regsub {@.*$} $user "" user
regsub {^[^@]*@} $pass "" pass
vsend_uchar $server_sock 0
vsend_uchar $server_sock 0
vsend_uchar $server_sock 0
vsend_uchar $server_sock [string length $user]
vsend_uchar $server_sock 0
vsend_uchar $server_sock 0
vsend_uchar $server_sock 0
vsend_uchar $server_sock [string length $pass]
puts stderr "sending VencryptPlain user and pass."
puts -nonewline $server_sock $user
puts -nonewline $server_sock $pass
flush $server_sock
}
}
set ft 0
if {$fake_type == "None"} {
set ft 1
} elseif {$fake_type == "VncAuth"} {
set ft 2
} else {
puts stderr "no valid fake_type"
destroy .; exit 1
}
if {$viewer_major > 3 || $viewer_minor >= 7} {
vsend_uchar $viewer_sock 1
vsend_uchar $viewer_sock $ft
set t [vread 1 $viewer_sock]
binary scan $t c cr
if {$cr != $ft} {
puts stderr "client selected wront type $cr $ft"
destroy .; exit 1
}
} else {
puts stderr "viewer <= 3.3, faking things up."
# this should be MSB:
vsend_uchar $viewer_sock 0
vsend_uchar $viewer_sock 0
vsend_uchar $viewer_sock 0
vsend_uchar $viewer_sock $ft
if {$ft == 1} {
set t [vread 4 $server_sock]
}
}
}
global client_fh server_fh
set client_fh $viewer_sock
set server_fh $server_sock
fileevent $client_fh readable xfer_in_to_out
fileevent $server_fh readable xfer_out_to_in
}
proc vsend_uchar {sock n} {
set s [binary format c $n]
puts -nonewline $sock $s
flush $sock
}
proc vencrypt_constants {} {
uplevel {
set rfbSecTypeAnonTls 18
set rfbSecTypeVencrypt 19
set rfbVencryptPlain 256
set rfbVencryptTlsNone 257
set rfbVencryptTlsVnc 258
set rfbVencryptTlsPlain 259
set rfbVencryptX509None 260
set rfbVencryptX509Vnc 261
set rfbVencryptX509Plain 262
}
}
proc do_vencrypt {sock which} {
vencrypt_constants
set t [vread 1 $sock]
binary scan $t c vs_major
set t [vread 1 $sock]
binary scan $t c vs_minor
if {$vs_minor == "" || $vs_major == "" || $vs_major != 0 || $vs_minor < 2} {
puts stderr "vencrypt failure bad vs version major=$major minor=$minor"
destroy .; exit 1
}
puts stderr "server vencrypt version $vs_major.$vs_minor"
bmesg "server vencrypt version $vs_major.$vs_minor"
append_handshake "subversion=0.2"
vsend_uchar $sock 0
vsend_uchar $sock 2
set t [vread 1 $sock]
binary scan $t c result
if {$result != 0} {
puts stderr "vencrypt failed result: $result"
bmesg "vencrypt failed result: $result"
destroy .; exit 1
}
set t [vread 1 $sock]
binary scan $t c nsubtypes
puts stderr "nsubtypes: $nsubtypes"
bmesg "nsubtypes: $nsubtypes"
for {set i 0} {$i < $nsubtypes} {incr i} {
set t [vread 4 $sock]
binary scan $t I stype
puts stderr "subtypes: $i: $stype"
append_handshake "sst$i=$stype"
set subtypes($stype) $i
}
set subtype 0
if [info exists subtypes($rfbVencryptX509None)] {
set subtype $rfbVencryptX509None
puts stderr "selected rfbVencryptX509None"
} elseif [info exists subtypes($rfbVencryptX509Vnc)] {
set subtype $rfbVencryptX509Vnc
puts stderr "selected rfbVencryptX509Vnc"
} elseif [info exists subtypes($rfbVencryptX509Plain)] {
set subtype $rfbVencryptX509Plain
puts stderr "selected rfbVencryptX509Plain"
} elseif [info exists subtypes($rfbVencryptTlsNone)] {
set subtype $rfbVencryptTlsNone
puts stderr "selected rfbVencryptTlsNone"
} elseif [info exists subtypes($rfbVencryptTlsVnc)] {
set subtype $rfbVencryptTlsVnc
puts stderr "selected rfbVencryptTlsVnc"
} elseif [info exists subtypes($rfbVencryptTlsPlain)] {
set subtype $rfbVencryptTlsPlain
puts stderr "selected rfbVencryptTlsPlain"
}
append_handshake "subtype=$subtype"
set st [binary format I $subtype]
puts -nonewline $sock $st
flush $sock
if {$subtype == 0} {
puts stderr "vencrypt could not find an acceptable subtype: $subtype"
destroy .; exit 1
}
set t [vread 1 $sock]
binary scan $t c result
puts stderr "result=$result"
append_handshake "done"
if {$result == 0} {
puts stderr "vencrypt failure result: $result"
destroy .; exit 1
}
}
proc do_connect_vencrypt {sock hostport which} {
global debug cur_proxy
vencrypt_constants
puts stderr "pxy=$which vencrypt $hostport via $cur_proxy"
bmesg "V: $which vencrypt $hostport via $cur_proxy"
append_handshake "mode=connect"
set srfb [vread 12 $sock]
puts stderr "srfb: $srfb"
bmesg "srfb: $srfb"
set srfb [string trim $srfb]
append_handshake "server=$srfb"
set minor ""
if [regexp {^RFB 00[456]\.} $srfb] {
set minor 8
} elseif [regexp {^RFB 003\.0*([0-9][0-9]*)} $srfb mvar minor] {
;
}
if {$minor == "" || $minor < 7} {
puts stderr "vencrypt failure bad minor=$minor"
destroy .; exit 1
}
set vrfb "RFB 003.008\n"
if {$minor == 7} {
set vrfb "RFB 003.007\n"
}
puts -nonewline $sock $vrfb
flush $sock
set vrfb [string trim $vrfb]
append_handshake "viewer=$vrfb"
append_handshake "latency=0.10"
set str [vread 1 $sock]
binary scan $str c nsec
puts stderr "nsec: $nsec"
bmesg "nsec: $nsec"
for {set i 0} {$i < $nsec} {incr i} {
set str [vread 1 $sock]
binary scan $str c sec
puts stderr "sec: $sec"
bmesg "sec: $sec"
set sectypes($i) $sec
}
for {set i 0} {$i < $nsec} {incr i} {
if {$sectypes($i) == $rfbSecTypeVencrypt} {
append_handshake "sectype=$rfbSecTypeVencrypt"
vsend_uchar $sock $rfbSecTypeVencrypt
after 500
bmesg "do_vencrypt $sock $which"
do_vencrypt $sock $which
return
}
}
for {set i 0} {$i < $nsec} {incr i} {
if {$sectypes($i) == $rfbSecTypeAnonTls} {
append_handshake "sectype=$rfbSecTypeAnonTls"
vsend_uchar $sock $rfbSecTypeAnonTls
bmesg "rfbSecTypeAnonTls"
after 500
append_handshake "done"
return
}
}
}
proc do_connect {sock type hostport which} {
if {$type == "http"} {
do_connect_http $sock $hostport $which
@ -390,6 +970,8 @@ proc do_connect {sock type hostport which} {
} elseif [regexp -nocase {^repeater:} $type] {
regsub -nocase {^repeater:} $type "" repeater
do_connect_repeater $sock $hostport $which $repeater
} elseif {$type == "vencrypt"} {
do_connect_vencrypt $sock $hostport $which
}
}
@ -431,9 +1013,6 @@ proc handle_connection {fh host port} {
fconfigure $fh -translation binary -blocking 0
fconfigure $sock -translation binary -blocking 0
fileevent $fh readable xfer_in_to_out
fileevent $sock readable xfer_out_to_in
set cur_proxy $proxy1
if {$proxy2 != ""} {
do_connect $sock $proxy1_type "$proxy2_host:$proxy2_port" 1
@ -451,6 +1030,9 @@ proc handle_connection {fh host port} {
} else {
do_connect $sock $proxy1_type $dest 1
}
fileevent $fh readable xfer_in_to_out
fileevent $sock readable xfer_out_to_in
}
proc proxy_type {proxy} {
@ -468,6 +1050,8 @@ proc proxy_type {proxy} {
return "http"
} elseif [regexp -nocase {^repeater://.*\+(.*)$} $proxy mat idstr] {
return "repeater:$idstr"
} elseif [regexp -nocase {^vencrypt://} $proxy] {
return "vencrypt"
} else {
return "http"
}
@ -482,111 +1066,132 @@ proc proxy_hostport {proxy} {
return $hp
}
proc setb {} {
wm withdraw .
button .b -text "CONNECT_BR" -command {destroy .}
pack .b
after 1000 check_callback
}
global env
set got_connection 0
set proxy1 ""
set proxy2 ""
set proxy3 ""
set client_fh ""
set server_fh ""
set do_bridge 0
set debug 0
if {$debug} {
if {! [info exists env(SSVNC_DEST)]} {
set env(SSVNC_DEST) "haystack:2037"
}
if {! [info exists env(SSVNC_PROXY)]} {
set env(SSVNC_PROXY) "haystack:2037"
}
if {! [info exists env(SSVNC_LISTEN)]} {
set env(SSVNC_LISTEN) "6789"
}
} else {
if {! [info exists env(SSVNC_DEST)]} {
destroy .; exit;
}
if {! [info exists env(SSVNC_PROXY)]} {
destroy .; exit;
}
if {! [info exists env(SSVNC_LISTEN)] && ! [info exists env(SSVNC_REVERSE)]} {
destroy .; exit;
}
if [info exists env(CONNECT_BR_DEBUG)] {
set debug 1
}
set dest $env(SSVNC_DEST)
if [info exists env(SSVNC_VENCRYPT_VIEWER_BRIDGE)] {
set s [split $env(SSVNC_VENCRYPT_VIEWER_BRIDGE) ","]
set listen [lindex $s 0]
set connect [lindex $s 1]
if [regexp {,} $env(SSVNC_PROXY)] {
set s [split $env(SSVNC_PROXY) ","]
set proxy1 [lindex $s 0]
set proxy2 [lindex $s 1]
set proxy3 [lindex $s 2]
} else {
set proxy1 $env(SSVNC_PROXY)
setb
do_vencrypt_viewer_bridge $listen $connect
set do_bridge 1
}
set proxy1_type [proxy_type $proxy1]
set proxy1_hp [proxy_hostport $proxy1]
if {$do_bridge} {
;
} else {
if {$debug && 0} {
if {! [info exists env(SSVNC_DEST)]} {
set env(SSVNC_DEST) "haystack:2037"
}
if {! [info exists env(SSVNC_PROXY)]} {
set env(SSVNC_PROXY) "haystack:2037"
}
if {! [info exists env(SSVNC_LISTEN)]} {
set env(SSVNC_LISTEN) "6789"
}
} else {
if {! [info exists env(SSVNC_DEST)]} {
destroy .; exit;
}
if {! [info exists env(SSVNC_PROXY)]} {
destroy .; exit;
}
if {! [info exists env(SSVNC_LISTEN)] && ! [info exists env(SSVNC_REVERSE)]} {
destroy .; exit;
}
}
set s [split $proxy1_hp ":"]
set proxy1_host [lindex $s 0]
set proxy1_port [lindex $s 1]
#set env(BMESG) 1
set proxy2_type ""
set proxy2_host ""
set proxy2_port ""
set dest $env(SSVNC_DEST)
if {$proxy2 != ""} {
set proxy2_type [proxy_type $proxy2]
set proxy2_hp [proxy_hostport $proxy2]
set s [split $proxy2_hp ":"]
set proxy2_host [lindex $s 0]
set proxy2_port [lindex $s 1]
}
if [regexp {,} $env(SSVNC_PROXY)] {
set s [split $env(SSVNC_PROXY) ","]
set proxy1 [lindex $s 0]
set proxy2 [lindex $s 1]
set proxy3 [lindex $s 2]
} else {
set proxy1 $env(SSVNC_PROXY)
}
set proxy3_type ""
set proxy3_host ""
set proxy3_port ""
set proxy1_type [proxy_type $proxy1]
set proxy1_hp [proxy_hostport $proxy1]
if {$proxy3 != ""} {
set proxy3_type [proxy_type $proxy3]
set proxy3_hp [proxy_hostport $proxy3]
set s [split $proxy3_hp ":"]
set proxy3_host [lindex $s 0]
set proxy3_port [lindex $s 1]
}
set s [split $proxy1_hp ":"]
set proxy1_host [lindex $s 0]
set proxy1_port [lindex $s 1]
bmesg "1: '$proxy1_host' '$proxy1_port' '$proxy1_type'";
bmesg "2: '$proxy2_host' '$proxy2_port' '$proxy2_type'";
bmesg "3: '$proxy3_host' '$proxy3_port' '$proxy3_type'";
set proxy2_type ""
set proxy2_host ""
set proxy2_port ""
set got_connection 0
if {$proxy2 != ""} {
set proxy2_type [proxy_type $proxy2]
set proxy2_hp [proxy_hostport $proxy2]
set s [split $proxy2_hp ":"]
set proxy2_host [lindex $s 0]
set proxy2_port [lindex $s 1]
}
proc setb {} {
wm withdraw .
button .b -text "CONNECT_BR" -command {destroy .}
pack .b
after 1000 check_callback
}
set proxy3_type ""
set proxy3_host ""
set proxy3_port ""
if [info exists env(SSVNC_REVERSE)] {
set s [split $env(SSVNC_REVERSE) ":"]
set rhost [lindex $s 0]
set rport [lindex $s 1]
set rc [catch {set lsock [socket $rhost $rport]}]
if {$rc != 0} {
puts stderr "error reversing"
destroy .; exit 1
if {$proxy3 != ""} {
set proxy3_type [proxy_type $proxy3]
set proxy3_hp [proxy_hostport $proxy3]
set s [split $proxy3_hp ":"]
set proxy3_host [lindex $s 0]
set proxy3_port [lindex $s 1]
}
puts stderr "SSVNC_REVERSE to $rhost $rport OK";
setb
handle_connection $lsock $rhost $rport
} else {
set lport $env(SSVNC_LISTEN)
set rc [catch {set lsock [socket -myaddr 127.0.0.1 -server handle_connection $lport]}]
if {$rc != 0} {
puts stderr "error listening"
destroy .; exit 1
bmesg "1: '$proxy1_host' '$proxy1_port' '$proxy1_type'";
bmesg "2: '$proxy2_host' '$proxy2_port' '$proxy2_type'";
bmesg "3: '$proxy3_host' '$proxy3_port' '$proxy3_type'";
if [info exists env(SSVNC_REVERSE)] {
set s [split $env(SSVNC_REVERSE) ":"]
set rhost [lindex $s 0]
set rport [lindex $s 1]
set rc [catch {set lsock [socket $rhost $rport]}]
if {$rc != 0} {
puts stderr "error reversing"
destroy .; exit 1
}
puts stderr "SSVNC_REVERSE to $rhost $rport OK";
setb
handle_connection $lsock $rhost $rport
} else {
set lport $env(SSVNC_LISTEN)
set rc [catch {set lsock [socket -myaddr 127.0.0.1 -server handle_connection $lport]}]
if {$rc != 0} {
puts stderr "error listening"
destroy .; exit 1
}
puts stderr "SSVNC_LISTEN on $lport OK";
setb
}
puts stderr "SSVNC_LISTEN on $lport OK";
setb
}

@ -97,6 +97,42 @@ OPTIONS
END
exit 0
fi
if [ "X$1" = "X-ssh" ]; then
if [ "X$2" = "X-help" -o "X$2" = "X-h" ]; then
cat << END
sshvnc - a GUI wrapper for SSH VNC connections.
SYNOPSIS
sshvnc
sshvnc [host][:display]
sshvnc [saved-profile-name]
sshvnc [options] [host-or-profile]
sshvnc --help
See 'ssvnc $2' and 'ssvnc --help' for more information.
END
exit 0
fi
fi
if [ "X$1" = "X-ts" -o "X$1" = "X-tso" ]; then
if [ "X$2" = "X-help" -o "X$2" = "X-h" ]; then
cat << END
tsvnc - a GUI wrapper for SSH VNC connections using x11vnc Terminal Services.
SYNOPSIS
tsvnc
tsvnc [host][:display]
tsvnc [saved-profile-name]
tsvnc [options] [host-or-profile]
tsvnc --help
See 'ssvnc $2' and 'tsvnc --help' for more information.
END
exit 0
fi
fi
if [ "X$XTERM_PRINT" != "X" ]; then
XTERM_PRINT=""
@ -113,9 +149,10 @@ PATH=$PATH:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin:/usr/sfw/b
export PATH
if [ "X$FULLNAME" = "XKarl J. Runge" ]; then
VNCVIEWER_POPUP_FIX=1
export VNCVIEWER_POPUP_FIX
if [ "X$NOPOPUFIX" = "X" ]; then
VNCVIEWER_POPUP_FIX=1
export VNCVIEWER_POPUP_FIX
fi
PATH=`echo "$PATH" | sed -e 's,runge/bin/override,-------------,'`
fi
@ -123,11 +160,12 @@ if [ "X$WISH" = "X" ]; then
WISH=wish
for try in wish8.4 wish wish8.3 wish8.5 wish8.6
do
if type $try > /dev/null; then
if type $try > /dev/null 2>&1; then
WISH=$try
break
fi
done
export WISH
fi

@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2006-2008 by Karl J. Runge <runge@karlrunge.com>
# Copyright (c) 2006-2009 by Karl J. Runge <runge@karlrunge.com>
#
# ssvnc_cmd:
#
@ -50,7 +50,7 @@
#
# See the TightVNC viewer documentation for on its cmdline arguments.
#
# For convenience, here is the current (7/2006) TightVNC viewer -help output:
# For convenience, here is the TightVNC 1.3dev5 viewer -help output:
#
# TightVNC viewer version 1.3dev5
#
@ -98,9 +98,10 @@ PATH=$PATH:/usr/bin:/bin
export PATH
if [ "X$FULLNAME" = "XKarl J. Runge" ]; then
VNCVIEWER_POPUP_FIX=1
export VNCVIEWER_POPUP_FIX
if [ "X$NOPOPUFIX" = "X" ]; then
VNCVIEWER_POPUP_FIX=1
export VNCVIEWER_POPUP_FIX
fi
PATH=`echo "$PATH" | sed -e 's,runge/bin/override,-------------,'`
fi

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -119,13 +119,13 @@ authentication.
TightVNC supports several different compression methods to encode
screen updates; this option specifies a set of them to use in order of
preference. Encodings are specified separated with spaces, and must
thus be enclosed in quotes if more than one is specified. Available
encodings, in default order for a remote connection, are "copyrect
tight hextile zlib corre rre raw". For a local connection (to the same
machine), the default order to try is "raw copyrect tight hextile zlib
corre rre". Raw encoding is always assumed as a last option if no
other encoding can be used for some reason. For more information on
encodings, see the section ENCODINGS below.
thus be enclosed in quotes if more than one is specified. Commas may be used to avoid spaces.
Available encodings, in default order for a remote connection, are
"copyrect tight hextile zlib corre rre raw". For a local connection
(to the same machine), the default order to try is "raw copyrect tight
hextile zlib corre rre". Raw encoding is always assumed as a last option
if no other encoding can be used for some reason. For more information
on encodings, see the section ENCODINGS below.
.TP
\fB\-bgr233\fR
Always use the BGR233 format to encode pixel data. This reduces
@ -312,6 +312,11 @@ Disable bell.
Prefer raw encoding for localhost, default is
no, i.e. assumes you have a SSH tunnel instead.
.TP
\fB\-notty\fR
Try to avoid using the terminal for interactive
responses: use windows for messages and prompting
instead. Messages will also be printed to terminal.
.TP
\fB\-sendclipboard\fR
Send the X CLIPBOARD selection (i.e. Ctrl+C,
Ctrl+V) instead of the X PRIMARY selection (mouse
@ -530,7 +535,8 @@ Meta_R Super_L Super_R Hyper_L Hyper_R or Mode_switch.
Cursor Shape: ~ -nocursorshape
X11 Cursor: ~ -x11cursor
Cursor Alphablend: ~ -alpha
Toggle Tight/ZRLE: ~ -encodings ...
Toggle Tight/Hextile: ~ -encodings hextile...
Toggle Tight/ZRLE: ~ -encodings zrle...
Toggle ZRLE/ZYWRLE: ~ -encodings zywrle...
Quality Level ~ -quality (both Tight and ZYWRLE)
Compress Level ~ -compresslevel

@ -1,7 +1,7 @@
#!/bin/sh
rm -rf ./src/tmp/* || exit 1
vers=1.0.24
vers=1.0.25
cd .. || exit 1

Loading…
Cancel
Save