Skip to content

vless ​

VLESS is a lightweight Xray protocol: the user's UUID, a command and the destination address, then a stream without encryption of its own (TLS/REALITY or VLESS Encryption encrypts it). Compatible with sing-box and Xray vless, including Vision, REALITY, XUDP, mux.cool and VLESS Encryption.

Inbound ​

FieldTypeDefaultMeaning
userslistrequired unless there are fallbacksUsers: name, uuid (required), flow
users[].flow"", xtls-rprx-vision""The user's flow; the client must send the same one
decryptionstringnoneThe server's VLESS Encryption key
fallbackslist—Where to hand a connection that is not VLESS: fallbacks

Socket settings are the listener block. Blocks: tls (including REALITY), transport, mux.

Fallbacks ​

A client that came without VLESS (a browser, a scanner) ends up at the site the inbound stands in front of, like Xray fallbacks. The first read after TLS decides: fewer than 18 bytes, a wrong version or the UUID of an unknown user means a fallback; an error after a known UUID is an ordinary error. For an inbound open to the internet the main mode is fallbacks to a real web server or REALITY. Without them an inbound with TLS answers by itself, like Caddy without a site for that name (built-in answer), and writes a warning about this at startup. trojan has the same list and the same choice.

yaml
inbounds:
  vless-in:
    vless:
      listen: :443
      users:
        - name: alice
          uuid: b831381d-6324-4d53-ad4f-8cda48b30811
      fallbacks:
        - server: 8080                    # everything else: the site on 127.0.0.1:8080
        - alpn: h2
          server: 127.0.0.1:8081          # HTTP/2 clients
        - path: /ws
          server: 127.0.0.1:8082          # an HTTP/1 request to /ws (and /ws?…)
        - name: blog.example.com
          server: 127.0.0.1:8083
          xver: 2                         # a PROXY v2 header before the data
      tls:
        sni: example.com
        alpn: [h2, http/1.1]
        certificate_path: /etc/ours/cert.pem
        key_path: /etc/ours/key.pem
Rule fieldMeaning
serverhost:port or a port (then 127.0.0.1) — where to hand the connection; required
nameA part of the server name (SNI) the client asked for; of the matching ones the longest is taken
alpnThe ALPN TLS agreed on (the server must offer it in tls.alpn)
pathThe path of an HTTP/1 request (/ and on), up to ?
xverThe version of the PROXY header before the data: 0 for none, 1 or 2

A rule is chosen by levels, as in Xray: first the name (rules without name complement every name), then the ALPN (rules without alpn complement every ALPN), then the path; on each level without a match the rule where the field is not set is taken. If there is none either, the connection is closed. The connection goes through routing as one of the inbound's (match: {inbound: vless-in} sees it), with server as its destination; the log says fallback connection to <server>.

Differences from Xray: server is only an address, not a unix socket; under TLS 1.2 the ALPN is not visible (rules by alpn do not match); with a decryption other than none fallbacks are an error, as in Xray.

Outbound ​

FieldTypeDefaultMeaning
serverhost:portrequiredThe server address
uuidstringrequiredThe user's UUID. Text that is not a UUID is accepted as a version 5 UUID of it (as in Xray), with a warning in check and at startup
flow"", xtls-rprx-vision""Vision
networktcp, udp or a listbothWhat to pass
packet_encodingxudp, packetaddr, ""xudpHow to carry UDP, see below
encryptionstring or blocknoneThe client's VLESS Encryption: the key as a string or a block {key, cipher}; cipher is auto, aes-256-gcm, chacha20-poly1305, auto by default (= AES-256-GCM). encryption_cipher next to it is an error

Blocks: tls, transport, mux, dial.

Vision (xtls-rprx-vision) ​

Vision pads the start of the connection and, when TLS 1.3 runs inside, stops encrypting what is already encrypted: the client and the server switch to direct forwarding. Requirements:

  • the connection to the server is TLS or REALITY without a transport; with transport it is the error flow: Vision over transports is not supported (except with VLESS Encryption);
  • on the server the user's flow matches the client's (flow mismatch);
  • UDP with Vision goes only through XUDP (which is the default); the server rejects a bare UDP request under Vision.

UDP, XUDP and mux ​

The outbound's packet_encoding:

  • xudp (default) — UDP sessions through Xray mux.cool/XUDP;
  • packetaddr — the V2Ray way: the address in every packet;
  • "" (an explicitly empty string) — plain VLESS UDP: one session, one destination address.

The inbound understands all three without configuration. Besides, the inbound always accepts Xray mux.cool multiplexing (the mux command), and sing-box multiplexing (sing-mux) only when there is a mux block. An outbound with a mux block uses sing-mux, and with mux: {xray: …} mux.cool, like an Xray outbound with mux.enabled.

VLESS Encryption ​

Xray's post-quantum encryption (ML-KEM-768 + X25519) over VLESS, without TLS or together with it (with it Vision also works through transports). The key strings are compatible with Xray (xray vlessenc):

  • the server, decryption: mlkem768x25519plus.<mode>.<ticket time>.<private keys>, where the time is 600s or a range 300-600s;
  • the client, encryption: mlkem768x25519plus.<mode>.<0rtt|1rtt>.<public keys>.

The mode is native, xorpub or random, the same on both sides. The keys are base64url: on the server a private X25519 key (32 bytes) or an ML-KEM seed (64 bytes), on the client a public X25519 key (32 bytes) or an ML-KEM key (1184 bytes); up to 16 keys separated by dots. Between the time/RTT and the keys, padding can be given in the Xray format (100-35-35).

Example: REALITY + Vision ​

yaml
inbounds:
  vless-in:
    vless:
      listen: ":443"
      users:
        - name: alice
          uuid: b831381d-6324-4d53-ad4f-8cda48b30811
          flow: xtls-rprx-vision
      tls:
        sni: www.example.com
        reality:
          handshake:
            server: www.example.com:443
          private_key: SNfL-4rkF6mCzsOtOyo5-4k9mPbc1ASydCIK69G5vXU
          short_id: ["0123456789abcdef"]
outbounds:
  vless-out:
    vless:
      server: de.example.com:443
      uuid: b831381d-6324-4d53-ad4f-8cda48b30811
      flow: xtls-rprx-vision
      tls:
        sni: www.example.com
        utls:
          fingerprint: chrome
        reality:
          public_key: zEb3mQCQL9TQiNCyIDDPXYyJt1_ksA_WqsVztEINyV0
          short_id: "0123456789abcdef"
route:
  final:
    outbound: vless-out

Example: VLESS Encryption over XHTTP ​

yaml
inbounds:
  vlessenc-in:
    vless:
      listen: ":8080"
      decryption: mlkem768x25519plus.native.600s.cPFroczkNtCI0p7LDgCeMmq_9SbUDyx2jRJadapwRFA
      users:
        - uuid: b831381d-6324-4d53-ad4f-8cda48b30811
          flow: xtls-rprx-vision
      transport:
        xhttp:
          path: /x
outbounds:
  vlessenc-out:
    vless:
      server: cdn.example.com:80
      uuid: b831381d-6324-4d53-ad4f-8cda48b30811
      flow: xtls-rprx-vision
      encryption: mlkem768x25519plus.native.0rtt.dr0bPBjsO6yJD8rsajizkW11-PpxIprDIXSCf5r5t2A
      transport:
        xhttp:
          path: /x
          mode: stream-one
route:
  final:
    outbound: vlessenc-out

A minimal client is server, uuid and a tls block with sni. The keys in the examples are for demonstration.

Module description for developers: modules/vless.

GPL-3.0-or-later