Skip to content

HttpServer

std/http-server@1. An inbound HTTP Call. ack sends 202 after admission; respond waits for the graph response. A malformed body or failed authentication can refuse before admission, without inventing a request envelope or an exit.

This declaration comes from crates/rastok/src/lab.rs. Place the Connector in a Graph and wire its ports; the excerpt alone is not an App.

connector network : HttpServer {
listen = "127.0.0.1:8080"
codec = json
}

The contract index explains shared settings, build features and the distinction between a Contract, a Lab model and an installed Driver.

Selector: mode defaults to ack.

See inbound admission and backpressure: pending requests are retained within bounds, and the outbound Call queue rule does not apply to this Contract.

ModeDriver directionExchangeLab modelInstalled in this binary
ackinboundcalllab-http-serverNot compiled
respondinboundcalllab-http-serverNot compiled
ModePortDirectionType rule
ack, respondininputcodec = bytes → array<byte>; codec = json → variant; codec = string → string
ack, respondoutoutputSame as in
ack, respondexitoutputHttpServerExit, below
ModeOutput cardinality
ackOne admitted request out; exactly one request exit; no graph response
respondOne admitted request out; exactly one request exit; at most one response in
CasePayloadCall visibility
Completed{ status: int }Not an outbound Call
OutcomeUnknownEmptyNot an outbound Call
OverloadedEmptyNot an outbound Call
PeerDisconnectedEmptyNot an outbound Call
RequestExpiredEmptyNot an outbound Call

In mode = respond with codec = json, rastok check refuses a graph response whose resolved type contains a value without a JSON form, using E-TYPE-INVALID. A variant response is checked at execution instead; if its value cannot be encoded, the Driver sends HTTP 500 and reports OutcomeUnknown, without sending that value.

ModeSettingDomainPresence / defaultLatest phase
ack, respondauth_bearerstringoptionalinstance
ack, respondbehaviordeterministicdeterministicplan
ack, respondcodecbytes | json | stringrequiredplan
ack, respondheadersHTTP headersoptionalinstance
ack, respondcustom_headersmap<string,array<string>>optionalinstance
ack, respondlistenstringrequiredinstance
ack, respondmax_bodyByteSize"8MiB"plan
ack, respondpathstring"/"plan
ack, respondtls_certificatearray<byte>optionalinstance
ack, respondtls_private_keyarray<byte>optionalinstance
ack, respondversionsarray<http/1.1 | http/2 | http/3>["http/3", "http/2", "http/1.1"]plan
ack, respondzero_rttdisableddisabledplan
respondcorrelateexpression pathoptionalinvocation
respondtimeoutdurationrequiredinstance

The Lab scripts decoded ack requests through listener.out = value, then a successful 202. It does not exercise wire decoding or authentication. A respond Node can bind silently beside another simulated flow; authored source injection and graph-response scripting for that mode are deferred.

ack: No dedicated full-Contract fixture is declared. Related tests: crates/rastok/src/connector/drivers/network/http_server.rs, crates/rastok/tests/lab_http_source.rs.

respond: No dedicated full-Contract fixture is declared. Related tests: crates/rastok/src/connector/drivers/network/http_server.rs, crates/rastok/tests/lab_http_source.rs.

Diagram