Skip to content

katana

katana is an XrayR-compatible proxy node agent built on the Etemenanki kernel. It speaks UniProxy, one of the panel APIs XrayR speaks, plus helium’s own node API v2, and its [node.api] and [node.controller] keys are a snake_case subset of XrayR’s ApiConfig and ControllerConfig (host for ApiHost, node_id for NodeID, update_periodic for UpdatePeriodic, and so on). You point it at a panel (Xboard, V2board or helium) and give it a node ID. katana asks the panel what the node looks like and who may use it, serves that node, holds every user to their speed limit and to the panel’s audit rules, and reports each user’s traffic back to the panel.

This page is the map. It shows the moving parts, lists the panels and protocols katana supports, draws the line between what the panel decides and what your configuration file decides, and names the features katana leaves out on purpose. Read it before you write your first [[node]]; the rest of the katana section goes into each part in detail.

One katana process serves one or more nodes. Each [[node]] in the configuration file gets its own node manager, which keeps its own connection to its panel and runs its own copy of the Etemenanki runtime: its listener, its routing table, its outbounds and its DNS resolver. The file defines [[outbound]] and [dns] once, and every node builds its own copies from them, each with its own connections and resolver cache.

flowchart TB
  Panel["Panel: UniProxy or helium"]
  Client["Clients"]
  Dest["Destinations"]
  subgraph K["katana"]
    NM["Node manager"]
    L["Listener: TCP, TLS, REALITY, WebSocket, gRPC or QUIC"]
    Core["Protocol core"]
    Adm["User admission"]
    R["Router: audit rules first, then node.route"]
    P["Per-user speed limit"]
    O["The node's outbounds"]
  end
  Panel -- "node info, users, audit rules" --> NM
  NM -- "traffic, client addresses (helium)" --> Panel
  NM -. "lowers the answer and applies it" .-> L
  Client --> L --> Core --> Adm --> R --> P --> O --> Dest
  L -. "bytes per user" .-> NM

Two loops run side by side.

  • The control loop. Every update_periodic seconds (default 60), the node manager fetches the node’s settings and user list from the panel, refreshes the audit rules, applies any change, and reports the traffic counted since the last report.

  • The data path. A client connects to the node’s listener. The listener unwraps the transport (TLS, REALITY, WebSocket, gRPC, or QUIC for Hysteria 2) and hands the bytes to the protocol core, which authenticates the user against the list the panel supplied. Every flow the client opens, whether a TCP request, a mux sub-flow or a UDP association, then passes these stages. UDP packets are routed one at a time.

    1. Admission checks that the user is still in the node’s current user list. A user the panel has removed is refused, and their open connections are ended.
    2. The router tries the audit rules first, then the node’s [node.route] rules. An audit rule matches the flow’s domain name, the one the client asked for or the one sniffed from its first bytes, and sends the flow to a blackhole. A flow routed to block goes to a blackhole too.
    3. The speed limit paces the flow. All of one user’s flows on the node share one limit.
    4. The outbound connects to the destination: directly, or through an upstream proxy or WireGuard tunnel from [[outbound]].

    Meanwhile, the listener counts each user’s bytes as they cross it, and the node manager reports those counts to the panel.

katana dials the destination before it answers a client’s TCP request: VMess and VLESS send their response header only once the destination is connected. If the dial fails, the request ends instead; inside a mux connection, only that sub-flow ends. Trojan and Shadowsocks send no reply, so for them a failed dial closes the connection. A blackholed flow is the opposite case: it is answered as if connected, and then its stream ends without data.

This is a complete configuration for one node on an Xboard panel. Notice what is missing: no port, no protocol settings, no users. The panel supplies all of those.

/etc/katana/config.toml
# One node, served for an Xboard panel. Port, transport, TLS on/off and
# users all come from the panel; this file says how to reach it.
[[node]]
panel_type = "NewV2board" # Xboard and V2board (UniProxy API)
[node.api]
host = "https://panel.example.com"
node_id = 1
key = "replace-with-the-panel-key"
node_type = "V2ray" # the panel node is a VMess node
[node.controller]
listen_ip = "0.0.0.0"
update_periodic = 60 # seconds between panel polls and reports
[node.controller.cert] # used only if the panel turns TLS on
mode = "file"
cert_file = "/etc/katana/fullchain.pem"
key_file = "/etc/katana/privkey.pem"
[node.route]
default = "direct"

katana --test -c /etc/katana/config.toml checks the file and prints Configuration OK. For each node it builds the panel client, the outbounds, [dns] and the routing table, checks [node.hysteria] congestion, and for a node whose node_type is Hysteria 2 builds the listener from [node.hysteria] and the certificate, but it binds no port and does not contact the panel. What the panel will send is only checked when the node starts. Errors name the node they belong to, for example configuration error: node 1: route references unknown outbound relay. The configuration file page covers every key.

panel_type selects the panel API. katana compares it case-insensitively, so NewV2board, newv2board and NEWV2BOARD are the same.

Panel panel_type API katana calls Node types katana accepts
Xboard, V2board NewV2board or V2board UniProxy: GET /api/v1/server/UniProxy/config, GET …/user, POST …/push V2ray (VMess or VLESS), Trojan, Shadowsocks, AnyTLS, SOCKS, HTTP, Hysteria 2
helium Helium helium’s node API v2: GET /api/node/v2/{node_id}/config, GET …/users, POST …/report, with the key in an Authorization: Bearer header No node_type: the panel names the protocol, one of VMess, VLESS, Trojan, Shadowsocks, AnyTLS, SOCKS, HTTP, sss and Hysteria 2
  • V2board is an alias of NewV2board; both use the UniProxy client.
  • katana 6.0.0 removed SSPanel. SSpanel, in any case, is refused by name, at --test, at startup and on a reload: --test prints configuration error: node 1: panel_type "SSpanel" is not supported: katana serves the NewV2board and Helium panels, with the value as the file spells it. Upgrading to katana 6 covers moving such a node.
  • Any other value makes --test fail with configuration error: node 1: unknown panel_type "xboard" (the value is shown lowercased). At startup katana logs the same error, skips that node and starts the others; it exits only when no node can be started.
  • Every client sends If-None-Match with the last ETag the panel returned. When the panel answers 304 Not Modified, katana keeps the node settings, user list or rules it already has.
  • Every request asks for a gzip-compressed answer (Accept-Encoding: gzip), and katana reads a compressed answer as it decompresses it.
  • helium is supported from katana 4.5.0, and through its node API v2 from katana 5.0.0; katana 4.5.0 to 4.10.x called node API v1. Every body is a type of the helium-node-api crate, which helium serializes from the same definitions. The node config is typed by protocol and describes the whole inbound, so a helium node sets no node_type or enable_vless, and no [node.hysteria] key but congestion; katana refuses each of the others by name. The users answer says the speed and device limits once, for every user. See helium.
  • katana presents a client certificate when a panel asks for one, unless the node sets enable_mtls = false, and does not follow redirects: host must be the URL the panel answers at.
  • sss nodes are served from helium alone. A UniProxy node with node_type = "sss" fails --test with newV2board: no UniProxy panel describes an sss node; sss is Helium's own protocol, served with panel_type = "Helium".

The per-panel pages list every field katana reads: Xboard and V2board and helium.

On UniProxy panels, [node.api].node_type tells katana what kind of node the panel describes. It is compared case-insensitively. Any other value fails --test with node 1: unknown node_type "…", and at startup that node is skipped with the same error. A helium node sets none: its node config names the protocol.

node_type Protocol served Transports TLS UDP
V2ray (also vmess, vless) VMess with AEAD headers, or VLESS, with XTLS Vision over REALITY TCP, WebSocket, gRPC; REALITY on TCP for VLESS Optional, as the panel says, or REALITY Carried inside the connection, including mux.cool and XUDP
Trojan Trojan; each user’s password is their UUID UniProxy: TCP. helium: TCP, WebSocket or gRPC Always Carried inside the connection
Shadowsocks AEAD (SIP004) or Shadowsocks 2022 multi-user (SIP022), chosen by the panel’s cipher TCP, WebSocket, gRPC Optional, as the panel says Not served: katana binds no UDP socket for Shadowsocks
AnyTLS AnyTLS with the panel’s padding scheme; each user’s password is their UUID TCP Always Carried inside the connection, as UDP-over-TCP
Socks (also socks5), Http A SOCKS5 or HTTP proxy; each user’s account is their UUID, as name and password TCP, WebSocket, gRPC Required Not served
sss (helium only) sss, admitted by the user’s UUID TCP, WebSocket, gRPC Optional, as the panel says Carried inside the connection
Hysteria2 (also hysteria, hy2) Hysteria 2 over QUIC QUIC on UDP Always, inside QUIC When [node.hysteria].udp = true, or on helium when the panel sends udp
  • A UniProxy V2ray node serves VLESS instead of VMess when [node.api].enable_vless = true. On helium the panel’s protocol decides.
  • VMess, VLESS and Trojan nodes accept mux.cool from clients; Shadowsocks nodes do not. Each mux sub-flow is routed and audited on its own, and all of them draw on the user’s single speed limit.
  • Transport names from the panel are read case-insensitively: tcp or raw, ws or websocket, grpc or gun. An empty value means TCP.
  • A TLS or Hysteria 2 node needs [node.controller.cert].mode = "file" with a certificate and key in PEM files. A REALITY node needs none.
  • When a UniProxy panel names the node’s protocol, as Xboard does, katana refuses a node of another family than node_type; see The panel’s protocol tag.

Protocols describes each protocol’s settings and client requirements, and Hysteria 2 covers the local [node.hysteria] table.

What the panel decides, and what you decide

Section titled “What the panel decides, and what you decide”

katana splits a node’s settings in two. The panel owns everything clients must agree on and everything that changes per user. Your configuration file owns everything about this machine and this operator.

Setting Comes from Details
Listening port Panel UniProxy server_port; helium port. A locally described Hysteria 2 node uses [node.hysteria].port
Transport Panel network of V2ray, Shadowsocks, SOCKS and HTTP nodes; helium’s transport: TCP, WebSocket or gRPC
WebSocket path and Host, gRPC service name Panel The UniProxy network settings; helium’s transport
TLS on or off Panel UniProxy tls = 1 on V2ray, Shadowsocks, SOCKS and HTTP nodes, which SOCKS and HTTP require; helium’s security on VMess, VLESS, Shadowsocks and sss nodes. Trojan, AnyTLS and Hysteria 2 always use TLS, and so do SOCKS and HTTP on helium
REALITY Panel A VLESS node’s tls = 2 and tls_settings (UniProxy), or its security of type reality (helium): the server name, the cover site’s port, the private key and the shortId
VLESS flow Panel flow: empty, or xtls-rprx-vision over REALITY
Shadowsocks cipher and server key Panel UniProxy and helium cipher and server_key; a server_key only with a Shadowsocks 2022 cipher
AnyTLS padding scheme Panel padding_scheme, one line per entry
sss settings Panel helium’s transform and udp_max_datagram; the other sss settings keep their defaults. See sss
Users Panel ID and UUID of every user allowed on the node
Per-user speed limit Panel Each user’s speed_limit (UniProxy, in Mbps); on helium, the users answer’s limits.speed_limit, in bytes per second, which applies to each user on their own
Per-user device limit Panel Each user’s device_limit (UniProxy), or the users answer’s limits.device_limit (helium), enforced with [node.controller].enable_device_limit
Audit rules Panel, plus a local file UniProxy: the node’s routes with action = "block". helium sends none: only the local file applies
Hysteria 2 obfuscation Panel obfs and obfs-password (helium: obfs), unless you describe the node locally with [node.hysteria].port
Hysteria 2 rates Panel, or local UniProxy up_mbps, down_mbps and ignore_client_bandwidth, each overridden by [node.hysteria]; helium’s, which cannot be overridden
Hysteria 2 UDP relay and masquerade Local, or panel [node.hysteria]; on helium, the panel’s udp and masquerade
Panel connection Local panel_type and enable_mtls, and host, node_id, key, node_type (not on helium) and timeout (default 5 seconds) in [node.api]
VMess or VLESS Local [node.api].enable_vless. On helium the panel’s protocol decides
Certificates Local [node.controller.cert]. The panel’s certificate settings are not read, and a REALITY node needs no certificate
Listen address Local [node.controller].listen_ip, default "0.0.0.0"
Poll and report interval Local [node.controller].update_periodic, default 60 seconds. The panel’s push and pull intervals are not read
Outbounds Local [[outbound]], defined once and built by every node
Routing Local [node.route], one table per node
DNS Local [dns], defined once; every node builds its own resolver and cache from it
Speed-limit override Local [node.api].speed_limit in Mbps. Above 0, it replaces every user’s panel limit
Local audit rules Local [node.api].rule_list_path, one regular expression per line; blank lines and lines starting with # are skipped. katana reads the file together with the panel’s rules, so disable_get_rule = true turns local rules off too
Sniffing, rule fetching, traffic upload, VMess clock check Local disable_sniffing, disable_get_rule, disable_upload_traffic, disable_vmess_clock_check in [node.controller]
Device limit and IP ban Local enable_device_limit, ban_max_failures, ban_window_secs, ban_secs and carrier_max_failures in [node.controller], and, for a WebSocket node behind a reverse proxy, real_ip_header and real_ip_from. See Device limits and IP bans
Connections handed over by a relay on the same host Local handoff_dir and handoff_group in [node.controller]: a Unix socket per stream node. See Handed-over connections
Hysteria 2 listener Local [node.hysteria]: credential, udp, udp_idle_timeout, congestion and masquerade, plus port, obfs and obfs_password for a locally described node. On helium only congestion

Speed limits are in megabits per second, except helium’s, which are in bytes per second; katana converts 1 Mbps to 125 000 bytes per second. Speed limits explains how the limit is enforced.

  1. Start. The node manager fetches the node’s settings and its user list, loads the audit rules, builds the listener and binds it. If any part of the start fails, katana tries again, as the note after this list describes. When the listener is up, katana logs the address it bound. With listen_ip = "0.0.0.0" on a dual-stack host that is [::], one socket for IPv4 and IPv6 (see Nodes):

    2026-09-24T20:22:05.118204Z INFO katana::manager::node: node 1: listening on [::]:443
  2. Poll. One full update_periodic period after the node is up, and every period after that, the node manager runs one cycle: fetch the node settings, fetch the users, refresh the audit rules, apply changes, report traffic (and, on helium, client addresses). A failed fetch keeps the last settings and users that worked. Node settings katana refuses, such as a port outside 1 to 65535, keep the last node settings, while the users from that poll still apply. An accepted edit to the configuration file that affects the node’s panel client or its listener runs one cycle at once, without waiting for the timer.

  3. Change. What a change costs depends on what changed:

    • users added or removed, or a speed limit changed: katana applies the new user list in place. The connections of users who stay continue, and a new speed limit applies at once, to their open connections too; a removed user’s connections end.

    • new audit rules: they apply to new flows, and every connection continues.

    • a new port, transport, path, TLS or REALITY setting, protocol, flow, cipher, obfuscation or sss setting: katana applies the new settings and drops every connection on the node.

    • a new AnyTLS padding scheme, or new Hysteria 2 rates: they reach the connections that start after them, and every connection continues.

    • an edit to katana’s own configuration file: katana applies it without a restart.

      • A new listen address, certificate setting, disable_sniffing, [node.hysteria] setting (on helium, congestion) or routing rule drops every connection on the node. A change to [[outbound]] or [dns] drops every connection on every node.
      • Other [node.api] edits, such as speed_limit, rule_list_path or timeout, and an enable_mtls edit, apply live through a new panel client (a [node.hysteria] edit gets one too), which reads the node settings and users again at once. They drop connections only if the answer changes a panel setting that drops them, such as the port or transport. An enable_vless edit that keeps the requested type, as on a node_type = "vless" node, switches the node between VMess and VLESS, which drops them too.
      • A new panel_type, host, node_id or key names a different panel node, so katana stops the node and starts it again. On Xboard and V2board the same happens when a node_type edit changes the type katana asks for (a change of letter case does not), or when enable_vless changes on a V2ray or Vmess node, because UniProxy finds a node by the type it is asked for as well as its ID.
      • If the edited file’s outbounds, [dns] or any of its nodes do not build (panel_type = "SSpanel", an unknown node_type, any node_type on a helium node, or a rule that names a missing outbound, for example), katana refuses the whole reload and every node keeps running as it was.

      Hot reload lists what each edit does.

  4. Stop. On SIGINT or SIGTERM, each node closes its listener and every connection at once, reports its remaining traffic, and exits.

For the features below that a node can ask for, katana refuses the node instead of quietly doing something weaker: the node fails to start, or the change is not applied, with an error that names the feature.

Feature What katana does instead
ACME certificates (cert.mode = "dns", "http" or "tls") Refuses the node: node requests kernel-unsupported feature: ACME cert mode "dns". A Hysteria 2 node reports hysteria2 node requires cert.mode = "file" instead. Obtain and renew certificates yourself and use mode = "file".
REALITY anywhere but VLESS on TCP Refuses the node: REALITY on VMess fails with node requests kernel-unsupported feature: REALITY on a VMess node, over WebSocket or gRPC with security reality runs over transport tcp only.
XTLS flows other than Vision, and Vision off REALITY Refuses the node, for example node requests kernel-unsupported feature: VLESS flow "xtls-rprx-direct" or flow xtls-rprx-vision needs security reality.
A port outside 1 to 65535 from the panel Refuses the node: server_port 70000 is not a port (1 to 65535), rather than serve another port.
TCP header obfuscation (a TCP node whose header type is anything but none) Refuses the node: node requests kernel-unsupported feature: tcp header type "http". A TCP node with no header, a header without a type, or type none in any case, is served as plain TCP.
SOCKS and HTTP nodes without TLS Refuses the node: node requests kernel-unsupported feature: socks without TLS.
httpupgrade, splithttp and xhttp transports Refuses the node, for example node requests kernel-unsupported feature: httpupgrade transport. Any other unknown transport is refused the same way.
cert.reject_unknown_sni = true Refuses the node: node requests kernel-unsupported feature: cert.reject_unknown_sni.
Online users and alive IPs Not reported to UniProxy. katana never calls UniProxy alive or alivelist, so the panel shows no online users for the node. helium receives client addresses in each report when enable_device_limit is on.
Outbound source address Not applied. [node.controller].send_ip has no effect; outbound connections leave from the address the host’s routing table picks.
Node status Not reported. katana never sends UniProxy status, so the panel shows no CPU, memory or disk figures. Xboard still records the node’s check-in on every user-list request.
Audit-hit reports Not sent: neither UniProxy nor helium has an endpoint for them. katana still blocks the flows.
Shadowsocks obfs A UniProxy Shadowsocks node whose obfs is anything but empty, plain or none is refused. helium’s Shadowsocks config has no obfs.
Page Read it when you want to…
Quick start Bring up a first node against a panel
Configuration file Look up any key, its type and default
Xboard and V2board Set up the panel side for UniProxy, and see which fields katana reads
helium Connect a node to helium’s node API v2
Nodes Run several nodes in one process, choose ports and listen addresses
Protocols Serve VMess, VLESS (with REALITY and Vision), Trojan, Shadowsocks, AnyTLS, SOCKS, HTTP or sss, with TLS certificates
Hysteria 2 Serve a Hysteria 2 node, from the panel or described locally
Outbounds Send traffic through an upstream proxy or a WireGuard tunnel
Routing Write [node.route] rules with domains, CIDRs, ports, GeoIP and GeoSite
Speed limits Understand per-user and per-node limits and the override
Device limits and IP bans Hold users to the panel’s device limit and turn away failing clients
Audit rules Block destinations with panel or local rules
Traffic reporting Know when and how traffic reaches the panel
Hot reload Edit the configuration of a running katana
Deployment Install katana as a service
Upgrading to katana 6 Move a node off SSPanel, or drop the keys katana 6 removed
Migrating from XrayR Translate an XrayR configuration
Troubleshooting Read an error message or a node that does not come up