eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'HTTPServer':

Home

everywhere
www.exept.de
for:
[back]

Class: HTTPServer


Inheritance:

   Object
   |
   +--HTTPServer
      |
      +--FCGIServer

Package:
stx:goodies/webServer
Category:
Net-Communication-HTTP-Server
Version:
rev: 1.620 date: 2010/04/14 14:47:05
user: cg
file: HTTPServer.st directory: goodies/webServer
module: stx stc-classLibrary: webServer
Author:
Claus Gittinger and many merged-in pieces from others

Description:


Communicate with me via your favourite webBrowser ...
... see examples, howToStart and howToConfigure for setup information.

This class combines the functionalities of our own HTTPServer
(which itself was a merge of the WebServer and our existing file-access
 HTTPServer), and the new PWS (pluggable web server).

By setting up the ActionTable, FileRoot and HomeURL as required,
all of the above Web services (i.e. plugged, dynamic objects and file access)
are implemented here in a backward compatible fashion.

  Features:
HTTPServer does file caching - you may want to configure the number of
cached documents and the maxSize for caching by changing the maxCacheSize
and maxCacheDocumentSize variables.
The server also cares for open connections, timeouts, authentication etc.
Can also operate as slave under a master-apache via FCGI

  Operation Overview:
For each incoming request, a HTTPConnection is created (or reused) and
this is asked to handle the request (see #serve). 
HTTPConnection creates a HTTPRequest object, which is asked to generate a reply (#generateReply).
For reply, the requests asks me (the httpServer) back, to translate the requests URL
into an instance of HTTPService and a relative path (see #serviceAndLinkNameFromPath:into:).
The mapping of relative path to services is done via the linkResolver dictionary, into which
services can be registered/unregistered either programmatically or via the settings dialog
(#resolveServiceForPath: and #serviceForLink:ifAbsent:).

Finally, the service gets the request (#process:) and has to fill out the HTTPResponse object
which is passed along with the request (either directly or indirectly).
Eventually, when all intermediate methods return to the #generateReply of the HTTPRequest,
any collected html code is sent back to the original socket.

[History:]
    our own HTTPServer              - did file access only.
                                    - supports caching, keep-Alive, connections.
    merged WebServer                - added LinkedObjects
    improvements                    - added temporary links
    merged PWS                      - added an actionTable

[InstanceVariables:]
    port                            the port, on which this server is listening
    serverSocket                    the socket, on which this server is listening
    serverStatusHolder              a valueHolder holding this servers status (for monitoring)
    serverProcess                   process serving the connections
    serviceList                     list of registered services
    servicesSema                    accessLock
    linkResolver                    maps URLS
    linkHooks                       mappings for individual URLS
    temporaryLinks                  maps objects to temporary names
                                    These links are removed after being
                                    used - i.e. they are one-shot links
    temporaryObjectNames            maps temporary names to objects
                                    These links are removed after being
                                    used - i.e. they are one-shot links
    temporaryObjectNamesSema        accessLock
    temporaryLinksSema              accessLock
    temporaryLinkExpirationTime     the default expiration time for a temporary image
                                    sending with the response so the client can cache this links
                                    server removes that temporary links after that time
    homeURL                         the default URL (default is /Home)
    notFoundURL                     the url invoked if the service for the requested url is not found (default is nil)
    maintenanceMode                 boolean; if true, only local requests or requests includes the authorization for
                                    the ServerMaintenanceService are served
    backupJobs                      blocks to evaluate hourly
    maxNumberOfConnections          the max. number of simultaneous open connections.
    maxNumberOfKeepAliveConnections the max. number of kept connections.
                                    If more, the longest unused connection is closed.
                                    If 0, no connections are kept alive.
                                    (read about the WAIT_FIN TCP problem on
                                     why you may want to do this)
    keptConnectionsSema             accessLock
    keptConnections                 kept, still alive connections
    defaultFile                     obsolete
    verbose                         enables some debug messages (e.g. write header information to the Transcript) (default false)
    verboseData                     enables debug dump of incoming/outgoing data (default false)
    verboseErrors                   enables debug messages for error handling (default false)
    verboseTimeConsumtion           enables request time consumtion printouts to Transcript (default false)
    debugErrors                     enables debugging; if false, errors are cought and no debugger
                                    is opened (instead, the error is reported to the HTTP-requestor).
                                    If true, a regular debugger is opened.(default false)
    logFile                         a log file (will be in apache format soon)
    logToFile                       enables logging ti file
    logStream                       log stream to logFile
    loggingSema                     accessLock for logFile
    soapEnabled                     soap hook
    soapActionHandler
    realmUsersMap                   stores the user:password codes for all the authorization methods for each realm
    allowedAuthMethods              by now DIGEST and BASIC are supported
    settingsFilename                default filename were the server settings can be written to
    allowedHosts                    if non-nil, only those hosts are allowed (list of friends)
    forbiddenHosts                  if non-nil, those hosts are forbidden from connecting (list of intruders)

[ClassVariables:]
    CrLf                            common constant strings
    CrLfCrLf
    RunningServers  OrderedCollection
                                    list of all running http server instances


Related information:

    http://www.w3.org/Protocols/rfc2616/rfc2616.html
    HTTPInterface
    HTMLBrowser
    HTTPServer::Connection
    HTTPServer::Authorization
    HTTPRequest
    HTTPService

Class protocol:

accessing
o  forbiddenPeers
return the list of peers from known fraud sites.
cuge is here by default - they generate random ratings...

o  forbiddenPeers: aSequenceableCollection
set the list of peers from known fraud sites.
These are blocked from the server

o  forbiddenUserAgents
return the list of agents from known fraud sites.
cuge is here by default - they generate random ratings...

o  forbiddenUserAgents: aSequenceableCollection
set the list of agents from known fraud sites.
These are blocked from access

o  terminationRequest

class initialization
o  initialize
self loadRequiredClasses - cg: now done when first instance is created

o  installInLauncher

o  loadRequiredClasses

o  removeFromLauncher

configuring - setup
o  addToBackupJob: aJob
add a job (block) to be evaluated hourly by any server

constants
o  crlf

o  crlfcrlf

o  httpVersion

defaults
o  availableAuthenticationClasses

o  availableAuthenticationMethods

o  defaultAccessLogger
^ FullAccessLogger new.

o  defaultAllowedAuthenticationMethods
answer the alloed authenication methods.
We exclude Basic here, because it is insecure

o  defaultFile

o  defaultInactiveConnectionTimeout

o  defaultLogEnabled

o  defaultMaxNumberOfConnections

o  defaultMaxNumberOfKeepAliveConnections

o  defaultPort
return my default port number.
Use some high number here, since low ones (i.e. 80) are
reserved to super users. To use one below 1024, run ST/X as
setuid root.

o  defaultServerReplyPresenterClass

o  defaultServiceList

o  homeURL
return the defaultHomeURL - thats the URL used when an empty URL is entered
in the browser.

o  inactiveConnectionTimeout

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  logFile
default log file name server instance add '_portNumber' before suffix point

o  notFoundURL
return the default notFoundURL - thats the URL used when no service for the request is available.

o  port
for protocol compatibility with instances (to allow for common settings dialog)

o  realmUsersMap

o  settingsFilename

o  temporaryLockoutTime

defaults-caching
o  maxCacheSize

defaults-debugging
o  debugErrors

o  verbose

o  verboseData

o  verboseErrors

defaults-soap
o  defaultSoapEnabled

o  loadSoapPackage

o  soapEnabled

** This is an obsolete interface - do not use it (it may vanish in future versions) **

html composition
o  withSpecialHTMLCharactersEscaped: aStringOrCharacter
replace ampersand, less and greater by html-character escapes

instance creation
o  new

o  newServerOnPort: aPortNr
Creates a server on aPortNr and return the server instance.
This does NOT serve requests (i.e. it is not started)

o  newServerWithDefaultServiceListOn: port

o  newServerWithServiceList: aServiceList onPort: port

o  runningServerOnPort: aPort
return the server which is serving aPort or nil, if there is none.

o  runningServers
return a collection of running servers

o  serverOnPort: aPortNr
if already running, return an existing server which serves aPortNr.
If not, start one and return it.

o  soapEnabledServerOnPort: portNr
get an HTTPServer with SOAP enabled;
However, its serviceHandler does not yet have any services defined
(see Example services for more).

o  startServer
Start a server on the default port (8080) and return the server instance.
This starts a new process, which executes autonomously

o  startServerOnPort: aPortNr
Start a server on aPortNr and return the server instance.
This starts a new process, which executes autonomously.
See also #serverOnPort:aPortNr, which first looks, if there is already a server
running for that port.

obsolete
o  checkSwikiVersion
This is Squeak-Swiki 2.2.
Make sure that the Server:swiki folder is the version for 2.2.

o  disableMySwiki

o  rollForwardFrom: fileName
Roll the image forward using the given file.

o  setupMySwiki

private
o  addServer: aServer

o  removeServer: aServer

queries
o  defaultServer

o  isRunning
return true, if a server is running on defaultPort

o  isRunningOnPort: aPort
return true, if a server is running on aPort

queries-service
o  makeValidLinkName: eachLinkName

read/write settings
o  instanceSettingsList
answer a list of instance variables to be saved as server settings

o  serverFromSettingsFile: aFilename
create a new HTTP server from the setting stored in aFilename

o  serverFromSettingsStream: aStream
create a new HTTP server from the setting stored in aStream

serving
o  stopAllServers
Stop all running http servers.
This is done kind of softly, allowing the current request to be finished.

o  stopServer
Stop the default server.
This is done kind of softly, allowing the current request to be finished.

o  stopServerOnPort: aPort
Stop the server for aPort.
This is done kind of softly, allowing the current request to be finished.

o  terminateAllServers
Stop all running http servers.
This is done kind of softly, allowing the current request to be finished.

serving-helpers
o  gifImageDataForImage: img
given an image, generate GIF-data


Instance protocol:

accessing
o  accessLogger

o  accessLogger: something

o  addListeningAddress: aSocketAddress
add aSocketAddress to the list of addresses, that this server is listening.
You have to restart the server, if it is already running.

o  allowedHosts

o  closeConnectionAfterError
to avoid getting hoged down by a bad guy, limit his access speed,
by closing the connection

o  inactiveConnectionTimeout
seconds

o  inactiveConnectionTimeout: something
seconds

o  listeningAddresses

o  listeningAddresses: something

o  maxNumberOfConnections

o  maxNumberOfConnections: aNumber

o  maxNumberOfKeepAliveConnections

o  maxNumberOfKeepAliveConnections: aNumber

o  port
answer the (IPV4-)port, that we are or will be listening on.
This is not very well defined and kept only for backward compatibility

o  port: aPort
backward compatibility.
Set the IPV4-port of the server

o  realmUsersMap

o  realmUsersMap: aDict

o  serverHostName
Something pretty printed information about where we are running

o  serverHostName: aString
Set the name of the server - only for informational purposes.
If mothing is set, the host name is used.

o  serverProcess

o  serverProcess: something

o  serverReplyPresenter
the default server reply presenter
an instance for this class is created for every new request
this valid until the service is changing the presenter
if the service replyPrsenterClass is nil this replyPresenter is kept
during running through the service

o  serverReplyPresenter: something

o  serverStatusHolder
return a valueHolder holding the servers status (as a symbol)

o  serviceList

o  serviceList: aServiceSet

o  servicesSema

o  settingsFilename

o  settingsFilename: something

o  soapEnabled

o  soapEnabled: aBoolean

o  startupTime

o  tentativeObjectService
answer an tentative object service.
For backward compatibility: if there is none, create it on the fly

accessing-debugging & logging
o  addAlias: anAlias for: anUrl

o  debugErrors

o  debugErrors: aBoolean
if true, errors will trigger a debugger

o  logFile
return the name of the log file

o  logFile: something

o  removeAliasFor: anUrl

o  standaloneMode
answer true, if we are running in standalone mode.
In this mode, even breakpoint exceptions are ignored

o  verbose
return the verbose flag - if set, trace messages are sent to the transcript

o  verbose: something
set/clear the verbose flag - if set, trace messages are sent to the transcript

o  verboseData
return the verboseData flag - if set, request data is dumped to the transcript

o  verboseData: something
set/clear the verboseData flag - if set, request data is dumped to the transcript

o  verboseErrors
return the verboseErrors flag - if set, errornous requests are logged to the transcript

o  verboseErrors: something
set/clear the verboseErrors flag - if set, errornous requests are logged to the transcript

o  verboseTimeConsumtion
this flag enables some timing statistics

o  verboseTiming
this flag enables some timing statistics

o  verboseTiming: something
this flag enables some timing statistics - the default is false

accessing-http session
o  httpSessionAt: anId

o  httpSessionAt: anId ifAbsent: aBlock

o  httpSessionAt: anId put: aHTTPSession

o  httpSessionRemove: aString

o  removeTimedOutSessions
Associated with the minute job. Removes sessions that have become invalid

<return: self>

authentication-users
o  addRealm: aRealm
add a realm to the list of known realms

o  addUser: aUserName password: aPassword toRealm: aRealm overWrite: overWrite
this message is sent if a user is added to a realm or changed.
If overWrite is true, the data of an already existing user is overwritten.

o  allRealms
answer a collection of realm names known

o  allowedAuthMethods
answer a collection of allowd authenticatation method names

o  allowedAuthMethods: something

o  allowedAuthenticationClasses
answer a collection of authenticators that may be used to authenticate

o  canAuthenticate: aRequest with: authenticator
is it allowed to authenticate using authenticator?

o  canAuthenticateWith: authenticator

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  forbiddenUserAgents

o  hasUser: aUserName forRealm: aRealm
is aUserName known in aRealm?

o  removeRealm: aRealm
remove aRealm completely

o  removeUser: aUser fromRealm: aRealm
remove a user from a realm

o  usersForRealm: aRealm
answer the users belonging to aRealm

authorization-hosts
o  addToAllowedHosts: aHostAddr
add aHostAddr to the list of addresses, that are allowed to connect to the server.
If there is a single entry in allowedHosts, only connections are permitted from peers that are listed
in allowedHosts.
Must be a hostAddress (i.e. 4-byte ByteArrays)

o  addToForbiddenHosts: aHostAddr
add aHostAddr to the list of addresses, that are never allowed to connect to the server.
Must be a hostAddress (i.e. 4-byte ByteArrays)

o  allowAllHosts

o  forbiddenHosts
return the list of addresses, that are never allowed to connect to the server.
Contains hostAddresses (i.e. 4-byte ByteArrays)

o  forbiddenHosts: aCollection
set the list of addresses, that are never allowed to connect to the server.
Must contain hostAddresses (i.e. 4-byte ByteArrays)

o  isConnectionAllowed: socket
return true, if the connection given by socket is allowed.
Check:
1. if allowedHosts contains entries, it MUST contain the peers address
2. if forbiddenHosts MUST NOT contain the peers address
3. if temporaryForbiddenHosts MUST NOT contain the peers adress.
Entries in this collection will be removed by the server after some time (temporary not ok).

o  removeFromAllowedHosts: aHostAddr

o  removeFromForbiddenHosts: aHostAddr

o  temporaryForbid: aHostAddr
add aHostAddr to the list of addresses,
that are not allowed to connect to the server for some time.
This is used to protect against DOS attacks.
Must be a hostAddress (i.e. 4-byte ByteArrays)

change & update
o  update: something with: aParameter from: changedObject

configuring
o  addToBackupJob: aJob
add a job (block) to be evaluated hourly by this server

o  clearBackupJobs
Clear the backupJobs list.

o  setupServer
this is called immediately before the server is started

default-urls
o  homeURL
return the homeURL - thats the URL used when an empty URL is entered
in the browser.

o  homeURL: anURL
set the homeURL - thats the URL used when an empty URL is entered
in the browser.

o  notFoundURL
return the notFoundURL - thats the URL used when no service for the request was found

o  notFoundURL: something

o  rootUri
return the uri, that represents our root

initialization
o  initialize

links-action-soap
o  disableSoap

o  setupSoap

o  setupSoapWithHandler: aSoapServiceHandler

o  soapActionHandler

o  soapServiceHandler

logging
o  closeLogFile

o  createLogFileFor: fileNameOrStream

o  log: aString
write aString to our logfile

o  logCommented: aString
write a comment line to our log

o  logEnabled
answer true, if logging is enabled

o  logEnabled: aBoolean
if aBoolean == true, enable logging;
if false, disable logging

o  newLogFileNameFor: fileName
creates a backup filename string from a given filename

o  openNewLogFile
backup existing logfiles and open a filestream on the logfile name

o  verboseLog: aString
do verbose logging of aString (to Transcript)

obsolete
o  logToFile: something

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  startServer

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  startServerOnPort: aPortNr

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  stopServer

** This is an obsolete interface - do not use it (it may vanish in future versions) **

obsolete-pwsswiki
o  setupAuthorizedSwiki
setup the authorized swiki service:
authorizedSwiki
In this swiki, you must be authorized to modify pages,
but anyone can read them.
In addition, to the secureSwiki, pages may include
embedded smalltalk (so be careful, to not let bad guys crash your system)
The initial user/password is 'test'/'secure'

o  setupAuthorizedSwikiNamed: swikiName
setup the authorized swiki service:
authorizedSwiki
In this swiki, you must be authorized to modify pages,
but anyone can read them.
In addition, to the secureSwiki, pages may include
embedded smalltalk (so be careful, to not let bad guys crash your system)
The initial user/password is 'secure'/'secure'

o  setupMySwiki
setup the unauthorized swiki service:
mySwiki
In this swiki, anyone can read and modify pages.

o  setupSecureSwiki
setup the secure swiki service:
secureSwiki
In this swiki, you must be authorized to modify pages,
but anyone can read them.
The initial user/password is 'test'/'test'

o  setupSecureSwikiNamed: aSecureSwikiName
setup the secure swiki service:
secureSwiki
In this swiki, you must be authorized to modify pages,
but anyone can read them.
The initial user/password is 'test'/'test'

o  setupSwikiNamed: swikiName
setup or restore a swiki service named swikiName.
In this swiki, anyone can read and modify pages.

printing
o  printOn: aStream

queries
o  connectionClass

o  doNightlySnapShot

o  hasSoapEnabled

o  overallNumberOfRequests
returns the overall number of served requests (both failed and successful)

o  overallNumberOfServedConnections
returns the overall number of served incoming connections

o  parametersPrintStrings

o  serverName
answer the server's name (for messages)

o  serverReplyPresenterFor: aRequest

regular jobs
o  doBackupJobs
This method is invoked every hour and is supposed to perform
required backup jobs. Applications may register for a backupaction to
be invoked hourly via #addToBackupJob:aJobBlock.
This is just a wrapper so we don't have to restart the server loop,
when we add/remove jobs.

o  doBackupJobs: jobCollection
This method is invoked every hour and is supposed to perform
required backup jobs. Applications may register for a backupaction to
be invoked hourly via #addToBackupJob:aJobBlock.
This is just a wrapper so we don't have to restart the server loop,
when we add/remove jobs.

o  doHourlyJobs
This method is invoked every hour and is supposed to perform cleanup actions.
Currently, it starts a garbage collect.
This is just a wrapper so we don't have to restart the server loop,
when we add/remove jobs.

o  doNightlyJobs
This method is invoked every midnight and is supposed to perform cleanup actions.
Currently, it purges old graphic and temporary links and performs a
compressing garbage collect.
This is just a wrapper so we don't have to restart the server loop,
when we add/remove jobs.

service-queries
o  allServiceLinkNames

o  fileServices

o  hasServiceForLink: aLinkName
Return true, if there is a service registered for aLinkName

o  hasServiceForServiceClass: aServiceClass
return true, if there is a link for a aServiceClass

o  linkResolver

o  resolveServiceForPath: aPath
get serviceLinkName and service instance for aPath

o  serviceAndLinkNameFromPath: aPath into: aRequest
get serviceLinkName and service instance for aPath,
and set them in aRequest.
Also set the path relative to the service link name.
Called for incoming requests to determine, which service is to handle it.

o  serviceForLink: aLinkName
Return the service registered for aLinkName, or nil if there is none.

o  serviceForLink: aLinkName ifAbsent: exceptionBlock
Return the service registered for aString, or the value from exceptionBlock if there is none.

o  servicesForServiceClass: aServiceClass
return the collection of instances, for which the class is aServiceClass.
empty collection if there is none.

service-registration
o  addFileServiceWithRootLinkName: aLinkName class: aFileServiceClass rootDirectory: aRootDirectory defaultFileName: aDefaultFilename

o  addFileServiceWithRootLinkName: aLinkName rootDirectory: aRootDirectory defaultFileName: aDefaultFilename

o  addLink: aLinkName toService: aService
add a link for aService

o  addServiceToServiceList: aService
add aService to the list of services.
If aService redefines link names,
unregister the old service using the same link names

o  changeLinksForService: aService
aService may have changed link names.
Update them

o  linkService: aService
register the links from aService

o  registerTentativeObjectService: aService
if no tentativeObjectService has been registered as default until now,
register aService

o  rewriteURLFor: anURL

o  setupServices: serviceList
setup defaults service links

o  unRegisterAllServices

o  unRegisterTentativeObjectService: aService
unregister aService, if is has been registered as default tentativeObjectService

o  unlinkService: aService
unlink aService.

serving
o  closeServerSocket

o  createServerProcess
Initialize the server to be run on the set port.
This creates and returns a new process, which can be started with #resume

o  loop
This is the inner HTTP server loop.
The logging argument may be a stream or a fileName or nil.
Periodically flush the logfile.
Invoke hourly and nightly jobs.

o  openServerSocket

o  restartServer
restart the server process

o  serve
This is the outer HTTP server loop.

o  start
Start the server on the default or before already set port.
This starts a new process, which executes autonomously

o  startOnPort: aPortNr
Start the server on aPortNr.
This starts a new process (if not already running), which executes autonomously

o  stop
tell the server to stop; notice that there is a chance, that the server
continues operation for some time.
It will finish any ongoing requests, however not accepting any new ones.
If the request(s) take too long to execute, they will be aborted
(i.e. sooner or later the server will be definitely stopped)

o  terminateServer
hard terminate the server - pending requests will not be finished

serving-helpers
o  addConnection: aConnection
remember aConnection

o  closeOldestConnection
close the oldest connection we currently hold

o  countRequest

o  doMinuteByMinuteActionAt: now
minutely action

o  removeConnection: aConnection
remove aConnection from the list of remebered connections

o  removeUnusedConnections
remove all connections that are inactive for some time (inactiveConnectionTimeout)

o  shutdownOldConnections
shut down (immediately) old connections, as we have too many already.
Here, shutDown the one with the longest already processing request
(could be a blocking one...)

serving-serverState
o  inMaintenanceMode
return true, iff in mainenance mode.
In this mode, no files are served (only Server.control-requests are served)

o  isInCollectGarbageStatus

o  isInQuitStatus

o  isInRestartServerStatus

o  isInSnapshotStatus

o  isRunning
true if serverProcess is up.
(but could still be in startUp or shutDown procedure

o  isServing
true if serverProcess is up and socket-connections are served

o  maintenanceMode: aBoolean

o  serverStatus
return the serverStatus as a symbol

o  waitForServerStatus: conditionBlock withTimeout: secondsOrNil
wait until server status changed, so that conditionBlock evaluates to true.
Raise Error on timeout, self otherwise

o  waitUntilServing
wait until I am serving requests

o  waitUntilStopped
wait until I am no longer serving requests

o  waitUntilStoppedWithTimeout: secondsOrNil
wait until I am no longer serving requests

serving-serverState-private
o  changeServerStatusTo: newStatus

o  changeServerStatusToBackingUpLogFile

o  changeServerStatusToCollectGarbage

o  changeServerStatusToError

o  changeServerStatusToNotRunning

o  changeServerStatusToQuit

o  changeServerStatusToRestartServer

o  changeServerStatusToServing

o  changeServerStatusToSnapshot

settings persistency
o  elementDescriptorFor: anAspect
support for persistency:
answer the elements to be made persistent with an ObjectCoder

o  fetchServerSettingsFrom: fromHttpServer
fetch all settings as in fromHttpServer

o  hasSameSettingsLike: aHTTPServer

o  hasSettingsFile

o  putSettingsOn: aStream

o  readSettingsFromFile: aFilename

o  saveSettingsToFile: aFilename

o  settingsString

temporary link-add/remove
o  clearTemporaryLinkIds
Clear all temp linkIds

o  expireOldTemporaryLinksFor: now
expire old temporary links

o  graphicLinkIdFor: anImage
Return the linkId for a temporary graphic link.

o  graphicLinkIdFor: anImage expirationTimeDelta: anExpirationTimeDelta
Return the linkId for a temporary graphic link.

o  removeTemporaryLinkInfoForUrlPath: urlPath
remove the temporary link if it is available

o  temporaryLinkPathFor: anObject type: aType
Return the linkId for a temporary object.

o  temporaryLinkPathFor: aValue type: aType expirationTimeDelta: anExpirationTimeDelta
Return the linkId for a temporary object with an lifeTime of anExpirationTimeDelta
of anExpirationTimeDelta in seconds. aValue may be a block (or other #value-responding)
thing; its value is computed when a client asks for the link

temporary link-queries
o  hasExpiredForLinkObject: aLinkObject time: aTime
return false if aLinkObject is valid (exists and has not expired). Otherwise return true

o  hasExpiredForUrlPath: urlPath time: aTime
return false if urlPath is valid (exists and has not expired). Otherwise return true

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  hasTemporaryLinkForLinkObject: aLinkObject

o  hasTemporaryLinkForUrlPath: aPath

o  temporaryLinkExpirationTime
return the time (in seconds) which controls how long temporary links should be kept

o  temporaryLinkExpirationTime: something
set the time (in seconds) which controls how long temporary links should be kept

o  temporaryLinkInfoForLinkObject: aLinkObject
retrieve a temporary objects linkInfo - or nil

o  temporaryLinkInfoForUrlPath: urlPath
retrieve a temporary objects linkInfo - or nil


Private classes:

    AbortRequestProcessing
    TerminationRequest

Examples:


Notice: st/x must run as setuid or rott in order to allow serving port 80 ... default setup & go:


 HTTPServer startServerOnPort:8080
one more than one port:


 HTTPServer startServerOnPort:8081
 HTTPServer startServerOnPort:9090
stop:


 HTTPServer stopAllServer
go:


 HTTPServer startServerOnPort:8080.


 HTTPServer startServerOnPort:80.


ST/X 6.1.1; WebServer 1.620 at exept:8081; Mon, 21 May 2012 17:49:58 GMT