v2026.9.4
All Bundles
Bundle Lightweight embedded web server. Handles inbound HTTP requests with typed access to method, path, headers, and body; Response supports content-type, compression, redirects, and cookies. Compile with -lib net_server.

Handler

Serves Web.Server handlers on the Web.HTTP.Server engine. Subclass and override Process. The adapter wraps the server's request and response so handler code sees the Web.Server API.

Inherits: HttpRequestHandler

Example

class MyHandler from Web.Server.Handler {
  New() { Parent(); }

  method : public : Process(request : Web.Server.Request, response : Web.Server.Response) ~ Bool {
    response->SetContentType("text/plain");
    response->WriteBody("hello");
    return false;
  }
}

Web.Server.Handler->Serve(MyHandler->New()->GetClass(), 8080);

Operations

Process # virtual

Handles a request. Subclasses must implement this. Declared virtual, which in Objeck is a declaration without a body: a concrete method here would be bound statically from ProcessGet below, so a subclass override would never run.

method : public : virtual : Process(request:Request, response:Response) ~ Bool

Parameters

NameTypeDescription
requestRequestrequest
responseResponseresponse

Return

TypeDescription
Booltrue to continue processing, false otherwise

Serve # function

Starts a server that dispatches to a Web.Server handler

function : Serve(handler:Class, port:Int) ~ Nil

Parameters

NameTypeDescription
handlerClasshandler class
portIntport to bind

Serve # function

Starts a server that dispatches to a Web.Server handler

function : Serve(handler:Class, port:Int, is_debug:Bool) ~ Nil

Parameters

NameTypeDescription
handlerClasshandler class
portIntport to bind
is_debugBooltrue for debug output