summaryrefslogtreecommitdiff
path: root/web/src/cgi.tcl-1.10/example/push.cgi
diff options
context:
space:
mode:
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."
+ }
+}