lmproxy

lmproxy is a statically-linked HTTP/HTTPS proxy daemon, URL and HTTP/1.x parser CLI, and LMScript host built on the embedded Squid 7 engine. It runs forward and transparent interception proxies with SSL-bump TLS inspection alongside structured URL and message parsing in _lmcode_.

Quick reference

npm install -g @lmctl-ai/lmctl@latest
lmproxy --version
lmproxy --lmcode-schema
lmproxy --lmcode-signatures
Interface or flagSignature or syntaxPurpose
CLI host bytecodelmproxy --lmcode prog.dslbExecute compiled LMScript bytecode against the embedded lmproxy schema.
CLI schema and signatureslmproxy --lmcode-schema [--json] | --lmcode-signaturesPrint human-readable schema summary, raw host schema JSON, or canonical signatures.
CLI URL and HTTP parserslmproxy parse-url URL... | lmproxy parse-request FILE | lmproxy parse-response FILEParse URLs or raw HTTP/1.x request and response messages with Squid 7 and emit JSON lines.
CLI forward and interceptlmproxy forward|intercept [--port P] [--ssl-bump] [--tap] [--record FILE]Run the embedded Squid 7 forward proxy (port 3128) or transparent intercept proxy (port 3129).
CLI traffic routing--route PATTERN=HOST:PORT | --redirect PATTERN=URL | lmproxy run --config FILESwap matched traffic to an alternate backend origin, return HTTP 307 redirects, or run a custom squid.conf.
context proxy: Proxyproxy.parse_url(s) | proxy.parse_request(s) | proxy.parse_response(s)Parse URLs, HTTP/1.x requests, and HTTP/1.x responses into strongly-typed Url and Message handles.
Url methodsu.valid() | u.scheme() | u.host() | u.port() | u.path() | u.userinfo()Inspect Squid 7 URL decomposition, explicit port presence, IP-literal host status, and parse errors.
Message methodsm.kind() | m.method() | m.target() | m.status() | m.header(name) | m.header_names()Inspect HTTP/1.x request or response framing, status codes, header values, and completeness.
Standard REST and CLIRestGet..RestOptions, RestHandler, CliCommand, CliOptionExpose _lmcode_ functions as HTTP routes (:param) or stateless CLI flags and commands via rest_serve and rest_cli.
p = _lmcode_ cli="lmproxy" install="github:lmctl-ai/lmproxy@latest";
let u = proxy.parse_url("http://user@example.com:8080/a/b?x=1");
assert_eq(u.valid(), true);
assert_eq(u.host(), "example.com");
assert_eq(u.port(), 8080);

@"/request/inspect"
fn get_inspect(x: RestExchange) -> void implements RestGet {
  let m = proxy.parse_request("GET /status HTTP/1.1\r\nHost: proxy.local\r\n\r\n");
  x.json("{\"method\":\"" + m.method() + "\",\"host\":\"" + m.header("host") + "\"}");
}
assert_eq(rest_cli(str_split("/request/inspect", " ")), "{\"method\":\"GET\",\"host\":\"proxy.local\"}");
end _lmcode_
res = run_lmcode(p);
require(res.ok, json_stringify(res));

Documentation pages

Source repository and releases