summaryrefslogtreecommitdiff
path: root/web/src/cgi.tcl-1.10/example/push.cgi
diff options
context:
space:
mode:
authorEduardo Chappa <echappa@gmx.com>2013-02-03 00:59:38 -0700
committerEduardo Chappa <echappa@gmx.com>2013-02-03 00:59:38 -0700
commit094ca96844842928810f14844413109fc6cdd890 (patch)
treee60efbb980f38ba9308ccb4fb2b77b87bbc115f3 /web/src/cgi.tcl-1.10/example/push.cgi
downloadalpine-094ca96844842928810f14844413109fc6cdd890.tar.xz
Initial Alpine Version
Diffstat (limited to 'web/src/cgi.tcl-1.10/example/push.cgi')
-rwxr-xr-xweb/src/cgi.tcl-1.10/example/push.cgi37
1 files changed, 37 insertions, 0 deletions
diff --git a/web/src/cgi.tcl-1.10/example/push.cgi b/web/src/cgi.tcl-1.10/example/push.cgi
new file mode 100755
index 00000000..75aeb98c
--- /dev/null
+++ b/web/src/cgi.tcl-1.10/example/push.cgi
@@ -0,0 +1,37 @@
+#!/depot/path/tclsh
+
+package require cgi
+
+cgi_eval {
+ source example.tcl
+
+ set boundary "ThisRandomString"
+
+ cgi_http_head {
+ cgi_content_type "multipart/x-mixed-replace;boundary=$boundary"
+
+ puts \n--$boundary
+ cgi_content_type
+ }
+
+ cgi_title "Multipart example - 1st page"
+ cgi_body {
+ h4 "This is an example of [italic server-push] as implemented
+ by the multipart MIME type. In contrast with client-pull, push
+ leaves the connection open and the CGI script remains in control
+ as to send more information. The additional information can
+ be anything - this example demonstrates an entire page being
+ replaced."
+ }
+
+ puts \n--$boundary
+ after 5000
+
+ cgi_content_type
+
+ cgi_title "Multipart example - 2nd page"
+ cgi_body {
+ h4 "This page replaced the previous page with no action on the
+ client side."
+ }
+}