mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #4969] [Question]: hysteria2 does not read/cannot find the masquerade file #3487
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#3487
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @warmpain9 on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4969
What are you trying to do?
Greetings, i have a masq file for hysteria2 by dir: /var/www/html with masq file, hysteria2 works just fine but when it comes to a website i can't get on it, sends an error, as ALPn i used h3, website doesn't work even when both 443 tcp and 443 udp ports are free to use. Am i doing something wrong? Or do i need to install something like caddy or nginx to make this work?
(as for domain, i have my own, connected to cloudflare's NS)
(on a server where hysteria set up w/o panels webiste works perfecrly fine)
What have you already tried?
Moving file in another directory
Making file lighter (a few Kb)
reinstalling 3x-ui
switching versions
3x-ui version
3.2.8
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 24.04
Screenshots or config snippets
No response
Before submitting
@github-actions[bot] commented on GitHub (Jun 5, 2026):
Hi @warmpain9 — this is a fundamental architectural difference between standalone Hysteria2 and Xray-core's Hysteria2 implementation.
Why the masquerade website doesn't work in a browser
Xray-core's Hysteria2 transport only listens on UDP (QUIC). The masquerade feature in Xray serves HTTP/3 responses over that same UDP socket — it disguises the inbound at the QUIC/protocol level. It does not open a TCP 443 listener.
When a regular browser navigates to
https://your-domain.com, it first tries a standard TCP/TLS connection. Since nothing is listening on TCP 443, the browser gets a connection error immediately and never attempts QUIC/UDP.Why it works in standalone Hysteria2
Standalone Hysteria2 has a
masquerade.listenHTTPS: :443option that opens a separate TCP 443 listener alongside the UDP one, so regular browsers hit a real HTTPS server. Xray-core does not expose this option — the masquerade config keys 3x-ui sends (type,dir,url, etc.) are passed through as-is to Xray, but there is nolistenHTTPS/forceHTTPSequivalent in the Xray Hysteria2 transport.This was also observed in issue #4553.
How to fix it
You need a web server (nginx or Caddy) to handle TCP 443 traffic:
nginx example — serves
/var/www/htmlover HTTPS on TCP 443 and adds anAlt-Svcheader so browsers know to upgrade to HTTP/3 on the next visit:In 3x-ui, set your Hysteria2 inbound to listen on a different port (e.g., 8443) if you want nginx to own 443 TCP, or keep Hysteria2 on 443 UDP while nginx listens only on TCP 443 (they don't conflict since one is UDP and the other is TCP — Linux treats them as separate sockets).
The masquerade setting inside 3x-ui (
type: file,dir: /var/www/html) then only applies when an HTTP/3-capable client (or the censor's active prober using QUIC) connects — which is fine for censorship-evasion purposes. Regular browser visits go through nginx on TCP 443.In short: yes, you need nginx or Caddy to make the website reachable from a browser. The 3x-ui masquerade config alone is not enough because Xray-core has no TCP listener for it.