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 flag | Signature or syntax | Purpose |
|---|---|---|
| CLI host bytecode | lmproxy --lmcode prog.dslb | Execute compiled LMScript bytecode against the embedded lmproxy schema. |
| CLI schema and signatures | lmproxy --lmcode-schema [--json] | --lmcode-signatures | Print human-readable schema summary, raw host schema JSON, or canonical signatures. |
| CLI URL and HTTP parsers | lmproxy parse-url URL... | lmproxy parse-request FILE | lmproxy parse-response FILE | Parse URLs or raw HTTP/1.x request and response messages with Squid 7 and emit JSON lines. |
| CLI forward and intercept | lmproxy 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 FILE | Swap matched traffic to an alternate backend origin, return HTTP 307 redirects, or run a custom squid.conf. |
| context proxy: Proxy | proxy.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 methods | u.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 methods | m.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 CLI | RestGet..RestOptions, RestHandler, CliCommand, CliOption | Expose _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
- Skill — agent authoring rules, proxy and parser CLI commands, arena and TLS safety bounds, exit codes, and verification steps.
- Guide — embedded Squid 7 architecture, SSL-bump TLS interception, traffic tapping and routing, and standard REST and CLI interfaces.
- Reference — complete CLI subcommands and flags, Proxy, Url, and Message methods, standard lmcode_std_v3 interfaces, and exit codes.