WebApplication

From Xojo Documentation


For desktop applications, see Application, ConsoleApplication, ServiceApplication.

Class (inherits from ServiceApplication)


New in 2010r4

WebApplication is the base class for web apps. It stores information about the app such as its version number, the name of the built app, the ports it uses, etc. A Web app project has an object called App whose super class is WebApplication.

Events
Close Open Stop
HandleSpecialURL Pause UnhandledException
HandleURL Resume
Properties
AcceptingConnections LaunchMessage fa-lock-32.png SSLPort fa-lock-32.png
ApplicationIdentifier fa-lock-32.png LaunchMessageDelay Security
AutoQuit LongVersion fa-lock-32.png SessionCount fa-lock-32.png
BugVersion fa-lock-32.png MajorVersion fa-lock-32.png SessionTimeout
BuildDate fa-lock-32.png MinorVersion fa-lock-32.png ShortVersion fa-lock-32.png
CurrentThread fa-lock-32.png Mode fa-lock-32.png StageCode fa-lock-32.png
DisconnectMessage fa-lock-32.png NonReleaseVersion fa-lock-32.png Timeout
ExecutableFile fa-lock-32.png PackageInfo fa-lock-32.png URL fa-lock-32.png
HTMLHeader fa-lock-32.png Port fa-lock-32.png
Icon fa-lock-32.png RegionCode fa-lock-32.png
Methods
Daemonize SessionAtIndex SleepCurrentThread
DefaultWebPage SessionForControl YieldToNextThread
DoEvents SessionForControlID
Quit SessionWithIdentifier

Notes

App quit defaults:

  • CGI apps quit when there are no more connected sessions (AutoQuit can be used to change this default).
  • Standalone apps do not quit unless the Quit method is called (AutoQuit can be used to change this default).

Session is not available from WebApplication event handlers.

CGI Web Applications only listen on the localhost interface.

fa-info-circle-32.png
ApplicationIdentifier must be specified in order for your web application to work.

Command-Line Parameters

When starting a stand-alone web application, you can supply these parameters on the command line:

Command Description
--port The port the web app listens to for a connection. This can be used to change the port that was used to build the web app.
 --port=9191
--MaxSockets The maximum number of allowed connected sockets. The default is 200. This is not the number of maximum users as the number of connections does not map one-to-one with the number of connected users. Do not set the value too high as it will increase memory and CPU usage.
 --MaxSockets=300

If you do not want any unsecured connections, set this value to 0.

--MinSockets The minimum number of allowed connected sockets. The default is 20.
 --MinSockets=50
--SecurePort The port the web app listens to for a secure connection. This can be used to change the port that was used to build the web app.
 --SecurePort=9898
--SslType (Available in 2016r1) Allows you to specify the type of security used. You can use these integer values: 3 (TLSv1), 4 (TLSv11), 5 (TLSv12, the default)
 --SslType=4
--MaxSecureSockets The maximum number of allowed secure connected sockets. This is not the number of maximum users as the number of connections does not map one-to-one with the number of connected users. Do not set the value too high as it will increase memory and CPU usage.
 --MaxSecureSockets=300
--NetworkInterfaceIndex The index value (of NetworkInterfaces) to use as the NIC for connections. 2017r2 or later also accept the value "Loopback" to allow listening only on the loopback interface.
 --NetworkInterfaceIndex=1
 --NetworkInterfaceIndex=Loopback
--SecureNetworkInterfaceIndex (Available with 2017r2) The index value (of NetworkInterfaces) to use as the NIC for secure connections. 2017r2 or later also accept the value "Loopback" to allow listening only on the loopback interface.
 --SecureNetworkInterfaceIndex=1
 --SecureNetworkInterfaceIndex=Loopback
--Certificate The path to the SSL certificate (available in 2015r2).
 --certificate=/full/path/to/file
--Logging The path to HTTP Log file.
 --logging=/full/path/to/file

Using SSL with Standalone Web Apps

Refer to the UserGuide:SSL for Standalone Web Apps topic for more details on how to set up a standalone web app with SSL.

See Also

WebSession, Session, WebPage classes; App function; UserGuide:Web Apps, UserGuide:SSL for Standalone Web Apps topics