Skip to content

Network Configuration

LingXiao’s network configuration covers web service, proxy, host allowlist, and hardened mode.

ConfigEnvironment VariableConfig PathDefault
HostLINGXIAO_WEB_HOSTserver.host127.0.0.1
PortLINGXIAO_WEB_PORTserver.portAuto-assigned
Dev ProxyLINGXIAO_WEB_PROXY_TARGET--
Terminal window
# Start CLI + Web service
LINGXIAO_WEB_PORT=8787 npm run cli
# In another terminal, start Vite dev server
cd web
LINGXIAO_WEB_PROXY_TARGET=http://127.0.0.1:8787 npm run dev

The network group controls proxy behavior:

SettingEnvironment VariableDescription
network.proxy.urlLINGXIAO_PROXY_URLProxy URL
network.proxy.llm_enabledLINGXIAO_PROXY_LLMRoute LLM requests through proxy
network.proxy.tools_enabledLINGXIAO_PROXY_TOOLSRoute tool requests through proxy
network.user_agentLINGXIAO_USER_AGENTCustom User-Agent
{
"network": {
"proxy": {
"url": "http://127.0.0.1:7890",
"llm_enabled": true,
"tools_enabled": false
},
"user_agent": "LingXiao/0.3"
}
}

allowedHosts controls the list of hosts network tools can access:

{
"allowedHosts": [
"registry.npmjs.org",
"api.github.com",
"pypi.org",
"127.0.0.1",
"localhost"
]
}

Hosts not in the allowlist will be rejected.

ScenarioBehavior
In-process self-callAlways exempt
Non-hardened localhostExempt
Hardened mode / non-localhostNot exempt, 429 triggers cooldown
Non-loopback binding without hardened modeStrong warning (not gated)

Enable hardened mode for non-loopback bindings:

Terminal window
export LINGXIAO_HARDENED_MODE=true

When hardened mode is enabled:

  • Authentication: Disables query token, header x-lingxiao-token only
  • Rate limiting: 429 triggers 30-second cooldown
  • Security: dangerous_command_guard and block_private_network forced on
  • One-way lock: Cannot be turned off via API after env var is set

When non-loopback binding is detected without hardened mode, the system outputs a strong warning log but does not prevent startup.

Local LLM gateway (port 62000) network behavior:

  • Gateway routes authenticate with virtual keys, not server token
  • Rate limited per virtual key quota: rpm / tpm / daily_token_budget
  • Rate limit hit returns 429 + error body