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
Closed Pause UnhandledException
HandleURL Resume
Opening Stop
Properties
AcceptingConnections Description fa-lock-32.png Port fa-lock-32.png
ApplicationIdentifier fa-lock-32.png ExecutableFile fa-lock-32.png RegionCode fa-lock-32.png
AutoQuit HTMLHeader fa-lock-32.png SSLPort fa-lock-32.png
AutoQuitTimeout Icon fa-lock-32.png Security fa-lock-32.png
BugVersion fa-lock-32.png LastSessionIndex fa-lock-32.png SessionCount fa-lock-32.png
BuildDate fa-lock-32.png MajorVersion fa-lock-32.png SessionTimeout
Copyright fa-lock-32.png MinorVersion fa-lock-32.png StageCode fa-lock-32.png
CurrentThread fa-lock-32.png NonReleaseVersion fa-lock-32.png Version fa-lock-32.png
Methods
Daemonize SessionAt Sessions
DefaultWebPage SessionForControl SleepCurrentThread
DoEvents SessionForControlID YieldToNextThread
Quit SessionWithIdentifier

Notes

App quit defaults:

  • 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.

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
--UploadPath Changes the default path used to save files that are uploaded or other large requests. (New in 2020r1)
--urllength Allows you to change the maximum number of characters allowed in a URL from 256 (the default) to a maximum of 2048.

Using SSL with Standalone Web Apps

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

See Also

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