The HttpServer ActiveX control enables
applications to host an embedded web server that provides documents
and other resources to browsers and HTTP clients. The
application configures the server and handles events generated
by incoming connections and requests. Default processing is
available for standard HTTP operations, allowing applications
to serve content without implementing the protocol exchange
themselves.
Applications can use request events to inspect the requested
resource, URL, query parameters, and headers. When custom handling is
required, the application has access to the request data and can
specify the response, with additional methods for sending response
data, modifying headers, redirecting requests, and returning
customized errors. This allows application-specific behavior
alongside the server's default processing, which is recommended
for standard operations where no customization is needed.
Virtual hosting methods allow applications to configure multiple
host names and aliases, while virtual path mappings control how
resources are exposed within each host. Virtual users, client
authentication functions, and access rights provide control over
protected resources. Applications can check permissions for a virtual
path, require authentication, and translate between virtual paths and
local file system paths.
CGI support allows applications to associate programs with virtual
paths or file name extensions. Functions expose CGI environment
variables and provide access to a program's output and exit code,
allowing the host application to coordinate external processing with
server activity. Together with custom request handling, these
capabilities support both file-based content and responses generated
for a particular request.
Server management methods allow the application to start, stop,
restart, suspend, and resume the service. You can also enumerate active
clients, inspect session addresses and identities, adjust idle timeouts,
and disconnect individual clients. Throttling can be used to limit
active connections, connections from a single address, and the rate
of incoming connections. Transfer information and server memory usage
properties provide additional visibility into activity and resource use.
This control uses an apartment threading model. Although the server
creates worker threads internally to manage client connections and
requests, events are not raised directly from those worker threads.
Instead, the control marshals event notifications back to its hosting
thread using the Windows message mechanism, so application event handlers
execute in the context of the thread that created the control. This
design simplifies event handling for applications that host the control,
particularly those based on a single-threaded event model such as
Visual Basic 6.0.
The control is best suited for applications serving a modest
number of concurrent clients. Event processing depends on the hosting
thread continuing to dispatch Windows messages, and lengthy processing
within an event handler can delay the handling of events generated by
other client sessions. Applications that require high levels of
concurrency or perform significant processing in response to server
events may be better served by a development environment that offers
greater control over threading and asynchronous event processing.
The SocketTools ActiveX Edition components are self-registering
controls that are compatible with any programming language that
supports the Component Object Model (COM) and the ActiveX control
specification. If you are using Visual Basic 6.0, Service Pack 6 (SP6)
is required. We recommend installing all available updates for your
development tools. Although the Visual Basic 6.0 runtime is supported
on Windows 11, the IDE itself is no longer officially supported by
Microsoft. Legacy IDEs and compilers may also require elevated
(administrator) privileges to run properly.
The ActiveX controls are supported on Windows 7, Windows Server
2008 R2, and later versions of both desktop and server editions of
Windows. For Windows 7, Service Pack 1 (SP1) is the minimum
requirement. For Windows 8 systems, the 8.1 update must be installed.
On ARM-based platforms, the minimum supported version is Windows 10
build 1709.
SocketTools includes components for both 32-bit (x86) and 64-bit
(x64) Windows platforms. All modern versions of Windows are 64-bit,
but we continue to include 32-bit components for compatibility with
legacy development tools such as Visual Basic 6.0. We also provide
native ARM64 ActiveX controls for systems running Windows on ARM. Note
that 32-bit applications on ARM run using x86 emulation, and Microsoft
no longer supports native ARM32 applications.
If you are using VBScript, Visual Basic for Applications (VBA), or
another scripting environment on an ARM-based system, be aware that
64-bit hosts will require ARM64 components, while 32-bit hosts will
use x86 components under emulation. This includes applications created
with Visual Basic 6.0. To reduce deployment complexity and avoid
confusion, SocketTools does not include ARM32 ActiveX controls in its
standard redistribution packages but they are available on request for
legacy or specialized scenarios.
When distributing an application which uses this control, you can
either install the OCX file as a shared component in the appropriate
system folder or in the same folder as your application executable. If
the control is installed in a shared system location, the installer
should manage it as a shared component to prevent other applications
from being affected when it is updated or removed. If you install the
control in the same folder as your executable, it is recommended that
you use registration-free activation or COM redirection to ensure that
the correct version of the control is loaded by the application.
This control has no external runtime dependencies beyond the
standard Windows system libraries. It does not require the Microsoft
Visual C++ Redistributable or any additional third-party libraries to
be installed. All required components are either provided by Windows
or statically linked into the ActiveX control, simplifying deployment
and eliminating the need to distribute additional runtime files.