HttpServer
Object Hierarchy:
Description:
public class HttpServer :
Listen
HTTP JSON RPC server (Soup.Server).
POST to rpc_path with auto-JSON
OLLMrpc.Request body (method in the body). Exact paths from
OLLMrpc.Http.routes dispatch by verb+path. Replies are auto-JSON
OLLMrpc.Response. Same
OLLMrpc.Request.dispatch path as socket RPC. Runs on the process main loop — no fork or thread pool inside the library.
Example
var http = new OLLMrpc.Transport.HttpServer(8080);
var cert = new OLLMrpc.Transport.Cert() {
dir = tls_dir,
ca_pem_path = ca_pem,
ca_key_path = ca_key,
server_san = true,
};
cert.ensure();
http.tls_certificate = cert.certificate;
http.start();
Content:
Properties:
- public ArrayList<string> banned_ips { get; set; }
Client IPs to drop on accept (flood ban). Small list; checked before
Soup.Server.accept_iostream.
- public string host { get; set; }
Bind host for
start. Empty →
Soup.Server.listen_local.
- public uint port { get; set; }
Bound TCP port. After
start with port 0, updated to the ephemeral port
Soup chose.
- public bool proxy { get; set; }
Expect PROXY Protocol v1 on each inbound TCP connection before TLS.
- public string rpc_path { get; set; }
Path for POST body-method RPC (Hello / stream).
- public TlsCertificate? tls_certificate { get; set; }
Server TLS identity. Non-null →
start listens with
Soup.ServerListenOptions.HTTPS.
Creation methods:
Methods:
Inherited Members:
All known members inherited from class OLLMrpc.Transport.Listen
All known members inherited from class GLib.Object
- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data
- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer
- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref