This is place holder for the app [CloudTk]. I am putting the place holder here and summary to keep me motivated to finish this. A Summary of the application It is based on WebSockit2me [http://wiki.tcl.tk/41298] - a TCP to WebSocket gateway that uses a noVNC to display Tk applications in modern Web Browser. It runs on Linux and requires an Xvnc server to be loaded. Tk applications are listed on a web page. TclHttpd dynamically launches an Xdisplay via Xvnc and then starts a window manager and launches the Tk application. It runs on Linux x86_64 or arm(Raspberry Pi). Please refer to the CloudTk website [http://172.104.5.86] where you can download the Starkit. Also if you go to the following url [http://172.104.5.86:5443/cloudtk/] you can see an example web page which has some Tk Applications listed from this wiki. Below are the two main files in the custom directory of TclHttpd. CloudTk.tcl controls the websocket to TCP gateway. Xdisplay.tcl uses "Standalone bgexec" [https://wiki.tcl.tk/13400] to launch an Xdisplay via Xvnc, the matchbox window manager and the Tk application. **** CloudTk.tcl **** === === ====== # Copyright (c) 2017 Jeff Smith # # See the file "license.terms" of TclHttpd for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # I made a few modifications to the Websocket library to make it work with TclHttpd. # # 1. In the procedure ::websocket::takeover changed the following line from # fconfigure $sock -translation binary -blocking on # to # fconfigure $sock -translation binary -blocking off # # # 2. In the procedure ::websocket::Receiver changed the following line from # binary scan $dta Iu mask # to # binary scan $dta I mask # # Without this change the intial handshake with the VNC or Telnet Server # was intermittent ie. did not connect. # # So make the above modifications and then save the following to # WebSocketTCP-gateway.tcl and drop in the custom directory. # # Setup the AuthUserFile and copy the default webmaster credentials to the file # outside the Starkit. if {![file exists $Config(AuthUserFile)]} { set fd [open $Config(AuthUserFile) w] puts $fd "webmaster:$authdefault(user,webmaster)" close $fd unset fd } # If the user is Upgrading noVNC by creating a noVNC directory outside the Starkit, # remap this new directory via Doc_AddRoot. # # The Config(starkitTop) array variable is defined in the main.tcl file of the # Starkit and is used by the startup scripts of TclHttpd to define certain paths. if {[file isdirectory [file join [file dirname $Config(starkitTop)] noVNC]]} { Doc_AddRoot /kanaka/noVNC [file join [file dirname $Config(starkitTop)] noVNC] } else { Doc_AddRoot /kanaka/noVNC [file join $Config(starkitTop) noVNC-master] } Mtype_Add .svg image/svg+xml Url_AccessInstallPrepend ::cloudtk::AccessHook Url_PrefixInstall /cloudtk [list ::cloudtk::Start /cloudtk] package require websocket namespace eval ::cloudtk { # ensure ::cloudtk namespace exists set ::Config(cloudtkVersion) 0.1.3 } proc ::cloudtk::Start {prefix sock suffix} { upvar #0 Httpd$sock data variable Target set suffix [Url_PathCheck [string trimleft $suffix /]] if {![regexp {.*(/)$} $suffix _ slash]} { set slash "" } if {[info exists ::Session:$suffix]} { upvar #0 Session:$suffix state if { $state(type) == {WsActive} } { Redirect_Self /cloudtk/ } else { return [::cloudtk::Session $sock $suffix] } } set noVNCpath {/kanaka/noVNC/vnc.html?path=cloudtk/$session&resize=remote&autoconnect=true} switch -- $suffix { "VNC" { ::cloudtk::Dynamic $sock $noVNCpath } default { append pagehtml "
\n" append pagehtml "Enter the Tk Application you wish to launch.\n
\n" append pagehtml "
\n" append pagehtml "