Commit Graph
109 Commits
  • refactor(xhttp): split fields by direction, expand outbound coverage
    Audit panel xhttp config against xray-core's runtime paths and split
    fields per direction so each side carries only what it actually uses:
    
    - Bidirectional (must match): host, path, mode, all xPadding*,
      session*/seq*, uplinkData*/Key, scMaxEachPostBytes
    - Server-only (inbound): noSSEHeader, scMaxBufferedPosts,
      scStreamUpServerSecs, serverMaxHeaderBytes
    - Client-only (outbound): uplinkHTTPMethod, uplinkChunkSize,
      noGRPCHeader, scMinPostsIntervalMs, xmux
    
    The inbound previously held client-only fields and the outbound was
    missing every must-match field beyond host/path/mode — meaning a
    panel-built outbound couldn't connect to an inbound with a custom
    xPaddingKey/sessionKey/etc.
    
    Headers stay on the inbound for URL-share purposes only; xray's
    listener ignores them at runtime, but they travel through the share
    link's `extra` blob so the client picks them up.
    
    Renames the URL helpers (applyXhttpPadding* -> applyXhttpExtra*) since
    the blob now carries more than padding, and folds path/host/mode into
    the helper so each link generator's xhttp branch is one line.
    
    Adds two enforcement points for xray's "uplinkHTTPMethod=GET only in
    packet-up" rule: the GET option is disabled when mode != packet-up,
    and a watcher on the outbound modal auto-clears GET when the user
    switches modes.
    
    Hides the XMUX block behind an `enableXmux` switch on the outbound
    form (mirrors the QUIC Params toggle) so the section doesn't clutter
    the form by default; fromJson auto-flips it on for outbounds with
    saved xmux config.
    
    Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
  • fix(vless): scope testseed to xtls-rprx-vision flow
    testseed is only meaningful for the exact xtls-rprx-vision flow, but the
    panel was emitting it for any non-empty flow (including the UDP variant)
    and keeping it on the inbound after the flow was cleared via the client
    modal. Tighten the gate end-to-end:
    
    - VLESSSettings.toJson (inbound + outbound) now only emits testseed when
      the flow is exactly xtls-rprx-vision and the array is 4 positive ints;
      default state is empty so unmodified inbounds omit the field entirely.
    - canEnableVisionSeed drops the udp443 variant per spec.
    - Form adds a tooltip + theme-aware help text and an inline error when
      the user partially fills the four inputs; submit is blocked in that
      state. Reset clears to empty (= use server defaults).
    - UpdateInboundClient strips a now-orphaned testseed when the spliced
      client no longer leaves any XRV flow in the inbound.
    - MigrationRequirements cleans up legacy rows where testseed lingered
      after flow changes or was saved for non-XRV flows by older versions.
    
    Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
  • new: vless reverse
    legacy reverse removed
  • Update QUIC params defaults and UI validations
    #4142
    Adjust QUIC parameter defaults and tighten form validation across inbound/outbound components.
    
    - Set default brutalUp/brutalDown to 65537 and only include them in JSON when congestion is 'brutal' or 'force-brutal'.
    - Change keepAlivePeriod defaults (inbound QUIC -> 5s, Hysteria stream -> 2s) and enforce minimums in the UI.
    - Expose and serialize additional QUIC fields in outbound QuicParams: init/max stream windows, init/max connection windows, maxIdleTimeout, disablePathMTUDiscovery, maxIncomingStreams.
    - Add UI min/placeholder constraints: stream/connection receive windows min=16384 and updated placeholders to show defaults, brutal fields min=65537, maxIncomingStreams min=8 (placeholders updated), keepAlive min adjusted.
    - Add Wireguard and Hysteria entries to Protocols.
    
    Touched files: web/assets/js/model/inbound.js, web/assets/js/model/outbound.js, web/html/form/outbound.html, web/html/form/stream/stream_finalmask.html.
  • Fix xhttp xPadding settings missing from generated links (panel + subs) (#4065)
    * Fix: propagate xhttp xPadding settings into generated subscription links
    
    The four `genXLink` helpers in `sub/subService.go` only copied `path`,
    `host` and `mode` out of `xhttpSettings` when building vmess:// /
    vless:// / trojan:// / ss:// URLs. Everything else — `xPaddingBytes`,
    `xPaddingObfsMode`, `xPaddingKey`, `xPaddingHeader`,
    `xPaddingPlacement`, `xPaddingMethod` — was silently dropped.
    
    That meant an admin who set, say, `xPaddingBytes: "80-600"` plus obfs
    mode with a custom `xPaddingKey` on the inbound had a server config
    that no client could match from the copy-pasted link: the client kept
    the xray/sing-box internal defaults (`100-1000`, `x_padding`,
    `Referer`), hit the server, and was rejected by
    
        invalid padding (queryInHeader=Referer, key=x_padding) length: 0
    
    The user-visible symptom on OpenWRT / Podkop / sing-box was
    "xhttp inbound just won't connect" — no obvious pointer to what was
    actually wrong because the link itself *looks* complete.
    
    Fix:
    
      * New helper `applyXhttpPaddingParams(xhttp, params)` writes
        `x_padding_bytes=<range>` (flat, sing-box family reads this) and
        an `extra=<url-encoded-json>` blob carrying the full set of xhttp
        settings (xray-core family reads this). Both encodings are emitted
        side-by-side so every mainstream client can pick at least one up.
      * All four link generators (`genVmessLink` via the obj map,
        `genVlessLink`, `genTrojanLink`, `genShadowsocksLink`) now invoke
        the copy.
      * Obfs-only fields (`xPaddingKey`, `xPaddingHeader`,
        `xPaddingPlacement`, `xPaddingMethod`) are only included when
        `xPaddingObfsMode` is actually true and the admin filled them in.
        An inbound with no custom padding produces exactly the same URL
        as before — existing subscriptions are unaffected.
    
    * Also propagate xhttp xPadding settings into the panel's own Info/QR links
    
    The previous commit covered the subscription service
    (sub/subService.go). The admin-panel side — the "Copy URL" / QR /
    Info buttons inside inbound details — has four more
    xhttp-emitting link generators in `web/assets/js/model/inbound.js`
    (`genVmessLink`, `genVLESSLink`, `genTrojanLink`, `genSSLink`) that
    had the exact same gap: only `path`, `host` and `mode` were copied.
    
    Mirror the server-side fix on the client:
    
    * Add two static helpers on `Inbound`:
      - `Inbound.applyXhttpPaddingToParams(xhttp, params)` for
        `vless://` / `trojan://` / `ss://` style URLs — writes
        `x_padding_bytes=<range>` (sing-box family) and
        `extra=<url-encoded-json>` (xray-core family).
      - `Inbound.applyXhttpPaddingToObj(xhttp, obj)` for the VMess base64
        JSON body — sets the same fields directly on the object.
    * Call them from all four link generators so an admin who enables
      obfs mode + a custom `xPaddingKey` / `xPaddingHeader` actually
      gets a working URL from the panel.
    * Only non-empty fields are emitted, so default inbounds produce
      exactly the same URL as before.
    
    Also fixes a latent positional-args bug in
    `web/assets/js/model/outbound.js`: both VMess-JSON (L933) and
    `fromParamLink` (L975) were calling
    `new xHTTPStreamSettings(path, host, mode)` — but the 3rd positional
    arg of the constructor is `headers`, not `mode`, so `mode` was
    landing in the `headers` slot and the actual `mode` field stayed at
    its default. Construct explicitly and set `mode` by name; while
    here, also pick up `x_padding_bytes` and the `extra` JSON blob from
    the imported URL so the symmetric case of importing a padded link
    works too.
    
    ---------
    
    Co-authored-by: pwnnex <eternxles@gmail.com>
  • kcp : default value maxSendingWindow
    MaxSendingWindow must be >= Mtu
  • XDNS finalmask: Support resolvers (client) and domains (server)
    Treat the xdns mask type as a multi-value setting and update forms accordingly. Inbound/outbound UdpMask models now return arrays for xdns (inbound: settings.domains, outbound: settings.resolvers) using Array.isArray checks. UI templates were split so 'header-dns' still uses a single domain string, while 'xdns' renders a tags-style <a-select> for multiple entries (domains/resolvers). Conditionals were made explicit (mask.type === ...) instead of using includes(). Changed files: web/assets/js/model/inbound.js, web/assets/js/model/outbound.js, web/html/form/outbound.html, web/html/form/stream/stream_finalmask.html.
  • Add ipsBlocked to Freedom
    Expose an ipsBlocked array on Outbound.FreedomSettings and wire it into the outbound form. The constructor now defaults fragment to {} and noises/ipsBlocked to arrays for robustness; fromJson/toJson handle ipsBlocked and omit it when empty. The outbound HTML adds a tag-style <a-select> bound to outbound.settings.ipsBlocked (with comma tokenization and placeholder) so users can enter IP/CIDR/geoip entries.
  • mKCP transport: Add cwndMultiplier
    Replace legacy KCP buffer options with cwndMultiplier and maxSendingWindow across models and UI. Updated KcpStreamSettings in web/assets/js/model/inbound.js and web/assets/js/model/outbound.js (constructor, fromJson and toJson) to remove congestion/readBuffer/writeBuffer and use cwndMultiplier/maxSendingWindow instead. Updated web/html/form/outbound.html to reflect the new KCP fields in the stream form and to include extensive template formatting/markup cleanup for consistency and readability.
  • finalmask
    Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
  • add hysteria inbound
    Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
  • Remove allowInsecure
    Remove the deprecated `allowInsecure`
  • Refactor TLS peer cert verification settings
    Removed verifyPeerCertByNames and pinnedPeerCertSha256 from inbound TLS settings and UI. Added verifyPeerCertByName and pinnedPeerCertSha256 to outbound TLS settings and updated the outbound form to support these fields. This change streamlines and clarifies certificate verification configuration between inbound and outbound settings.
  • Add UDP hop interval min/max support for Hysteria
    Replaces single UDP hop interval with separate min and max values in Hysteria stream settings. Updates model, JSON serialization, URL param parsing, and form fields for backward compatibility and enhanced configuration flexibility.
  • Add UDP mask support for Hysteria outbound
    Introduces a 'congestion' option to Hysteria stream settings and updates the form to allow selection between BBR (Auto) and Brutal. Adds support for UDP masks, including model, serialization, and UI for adding/removing masks with type and password fields.
  • Add Hysteria2 outbound protocol support
    Introduces support for the Hysteria2 protocol in outbound settings, including model, parsing, and form UI integration. Adds Hysteria2-specific stream and protocol settings, updates protocol selection, and enables configuration of Hysteria2 parameters in the outbound form.
  • feat: Add WebSocket support for real-time updates and enhance VLESS settings (#3605)
    * feat: add support for trusted X-Forwarded-For and testseed parameters in VLESS settings
    
    * chore: update Xray Core version to 25.12.8 in release workflow
    
    * chore: update Xray Core version to 25.12.8 in Docker initialization script
    
    * chore: bump version to 2.8.6 and add watcher for security changes in inbound modal
    
    * refactor: remove default and random seed buttons from outbound form
    
    * refactor: update VLESS form to rename 'Test Seed' to 'Vision Seed' and change button functionality for seed generation
    
    * refactor: enhance TLS settings form layout with improved button styling and spacing
    
    * feat: integrate WebSocket support for real-time updates on inbounds and Xray service status
    
    * chore: downgrade version to 2.8.5
    
    * refactor: translate comments to English
    
    * fix: ensure testseed is initialized correctly for VLESS protocol and improve client handling in inbound modal
    
    * refactor: simplify VLESS divider condition by removing unnecessary flow checks
    
    * fix: add fallback date formatting for cases when IntlUtil is not available
    
    * refactor: simplify WebSocket message handling by removing batching and ensuring individual message delivery
    
    * refactor: disable WebSocket notifications in inbound and index HTML files
    
    * refactor: enhance VLESS testseed initialization and button functionality in inbound modal
    
    * fix:
    
    * refactor: ensure proper WebSocket URL construction by normalizing basePath
    
    * fix:
    
    * fix:
    
    * fix:
    
    * refactor: update testseed methods for improved reactivity and binding in VLESS form
    
    * logger info to debug
    
    ---------
    
    Co-authored-by: lolka1333 <test123@gmail.com>
  • Vlessenc (#3426)
    * mlkem768
    
    * VlessEnc
  • add ech support (#3310)
    Co-authored-by: Alireza Ahmadi <alireza7@gmail.com>
  • XHTTP: server & client
    Remove scMinPostsIntervalMs, xmux, noGRPCHeader from the server side and add them to the client side.
    
    Before you could have them on sub json but I decided to remove them.