Clone
neumann
committed
on 02 Aug 04
some cleanup
xotcl/apps/comm/webserver.xotcl (+4 -3)
1 1 #!../../src/xotclsh
2   # $Id: webserver.xotcl,v 1.6 2006/09/27 08:12:39 neumann Exp $
  2 # $Id: webserver.xotcl,v 1.7 2007/08/06 11:35:56 neumann Exp $
3 3 array set opts {-root ../../doc -port 8086 -protected-port 9096 -pkgdir .}
4 4 array set opts $argv
5 5 lappend auto_path $opts(-pkgdir)
6 6 #if {$::tcl_platform(platform) eq "windows"} {lappend auto_path .}
7 7 package require XOTcl; namespace import -force xotcl::*
8 8
9 9 proc ! string {
10     set f [open /tmp/log w+];
  10   set f [open [::xotcl::tmpdir]/log w+];
11 11   puts $f "[clock format [clock seconds]] $string"
12     close $f}
  12   close $f
  13 }
13 14
14 15 @ @File {
15 16   description {
16 17     This small demo program starts two different webservers:
17 18     <ul>
18 19     <li>Firstly, it provides a sample web server that povides the documents in
19 20     ../../src/doc (or the files specified with -root) at port 8086
20 21     (or at the port specified via the -port option) as unprotected resources.
21 22     <p>
22 23     <li>Secondly, it starts a second webserver with basic access control
23 24     (it accepts test/test as user/password) on port 9096 (or on the
24 25     port specified via -protected-port). If it receives an request
25 26     for an resource named "exit", it terminates. For all other requests
26 27     it returns actual information about the user and the issued request.
27 28     </ul>
28 29     To see, how it works, contact it e.g. from netscape.
29 30   }
30 31 }
31 32
32 33 ! "#### webserver starting"