Ports and Listeners

Purpose

Listeners define how local applications and operating-system traffic enter chimera_client. They are the first boundary between an application and the proxy core, so listener selection should be treated separately from outbound protocol selection.

For most deployments, start with an application-level listener such as SOCKS5 or HTTP before enabling transparent or TUN-based capture.

Listener Overview

Configuration keyRoleTypical useNotes
port / http-portHTTP proxy listenerBrowsers, system HTTP proxyPrimarily TCP proxy traffic
socks-portSOCKS5 listenerGeneral application proxyingGood baseline for local testing
mixed-portHTTP + SOCKS5 listenerOne shared application endpointConvenient when clients expose only one proxy field
redir-portTransparent redirect listenerLinux gateway/router setupsPrimarily TCP redirect workflows
tproxy-portTransparent proxy listenerLinux TCP/UDP interceptionRequires firewall and policy-routing integration
external-controllerManagement APIGUI, dashboards, automationBind to loopback unless remote access is intentional
dns.listenDNS listenerLocal DNS interception/resolutionUsually used with enhanced DNS or TUN

Availability can depend on build features, platform support, and the exact chimera_client revision. A configuration key being accepted does not by itself guarantee that the corresponding runtime path is enabled.

Listener Selection

SOCKS5

SOCKS5 is the safest starting point when validating a new profile. It does not require route changes and is supported by a wide range of applications.

bind_address: "127.0.0.1"
allow_lan: false
socks_port: 7891

Use SOCKS5 first when you want to separate proxy-core behavior from operating system routing and DNS interception issues.

The currently audited Client SOCKS inbound does not provide a complete UDP ASSOCIATE relay path: UDP requests on this local inbound currently return unsupported. Do not infer local SOCKS UDP support from the existence of SOCKS outbound UDP handling elsewhere in the codebase.

HTTP Proxy

An HTTP proxy listener is convenient for browsers and operating-system proxy settings. HTTPS traffic normally enters through HTTP CONNECT tunneling.

port: 7890

Mixed Listener

A mixed listener accepts both HTTP-proxy and SOCKS-style clients on one port. It is useful for desktop setups where exposing a single endpoint is simpler than managing separate HTTP and SOCKS ports.

mixed-port: 7892

The currently audited mixed listener is likewise a TCP-focused local entry for HTTP/SOCKS use; its UDP path is explicitly unsupported. Use the protocol/status matrix when a deployment requires local UDP ingress rather than assuming a mixed port provides SOCKS UDP parity.

Transparent Listeners

redir-port and tproxy-port are intended for routing-level interception, primarily on Linux. They should not be treated as drop-in replacements for SOCKS5 or HTTP listeners.

Transparent proxying normally also requires:

  • firewall rules,
  • loop-prevention rules,
  • policy routing for TProxy deployments,
  • and a DNS strategy that preserves enough domain information for rule matching.

For host-wide interception, also see Tun Module.

Controller and DNS Bindings

Management and DNS listeners deserve stricter exposure rules than ordinary local proxy listeners.

During development, prefer loopback-only bindings:

external-controller: 127.0.0.1:9090

dns:
  enable: true
  listen: 127.0.0.1:1053

Do not expose the controller or DNS listener to a LAN or public interface unless you have intentionally configured access controls and understand the security impact.

Example Local Profile

The following layout keeps all application-facing services local while making listener roles explicit:

bind_address: "127.0.0.1"
allow_lan: false

port: 7890
socks_port: 7891
mixed_port: 7892
external_controller: "127.0.0.1:9090"

dns:
  enable: false

Exact accepted key spelling can vary between compatibility layers. When importing Clash/Mihomo profiles, preserve the original profile where practical and verify the normalized runtime configuration produced by the client.

Platform and Compatibility Notes

  • Application-level HTTP and SOCKS listeners are the easiest paths to validate across platforms.
  • Transparent redirect and TProxy workflows are platform-specific and require operating-system network configuration outside the YAML file.
  • TUN support has its own privilege, routing, and DNS requirements; see Tun Module.
  • Listener availability may be gated by Cargo features or runtime build choices.
  • Controller behavior should be treated as an API surface rather than a proxy protocol endpoint.

Troubleshooting

When a local application cannot connect through the core, check the listener before debugging outbound protocols:

  1. Confirm the process is running and the expected port is listening.
  2. Verify the application points to the correct listener type and port.
  3. Confirm the listener is bound to the expected address (127.0.0.1, LAN IP, or wildcard address).
  4. Check whether allow_lan or equivalent exposure settings block remote clients.
  5. Test with a minimal SOCKS5 or HTTP profile before enabling TUN, Redir, or TProxy.
  6. If routing works by IP but domain rules fail, inspect the DNS path as well.