Skip to content

feat: add XHTTP H3 and packet-up support#2649

Closed
HanaKDev wants to merge 12 commits into
MetaCubeX:Alphafrom
HanaKDev:Alpha
Closed

feat: add XHTTP H3 and packet-up support#2649
HanaKDev wants to merge 12 commits into
MetaCubeX:Alphafrom
HanaKDev:Alpha

Conversation

@HanaKDev

Copy link
Copy Markdown

This PR adds HTTP/3 and packet-up support for XHTTP.

The motivation comes from my deployment scenario where nodes run a mixed HTTP/3 + HTTP/2 setup behind a CDN. Supporting this configuration in Mihomo would be very helpful for such environments.

I have tested the implementation locally with:

  • HTTP/3 + packet-up
  • VLESS endpoints with encryption enabled
  • VLESS endpoints without encryption

All scenarios worked as expected.

During this process, I also cleaned up some earlier experimental code I wrote yesterday which caused vless_test to fail.

Although I carefully reviewed and adjusted the code generated with the help of generative AI, there may still be defects or improvements to be made. I would greatly appreciate any feedback or suggestions.

@oplexz oplexz left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@ma3uk

ma3uk commented Mar 29, 2026

Copy link
Copy Markdown

I confirm that XHTTP works correctly in stream-one mode. The issue with the endlessly increasing memory usage has also been fixed

@HanaKDev

Copy link
Copy Markdown
Author

While testing last night, the node was always inside a load-balancing group, so I didn’t notice that one of the nodes kept reporting a StreamDown error. I tested again with the v26.03 test build and found that it worked fine. After taking a closer look, it turned out there was a deadlock issue (which has now been fixed).

@ma3uk

ma3uk commented Mar 30, 2026

Copy link
Copy Markdown

I think this pull request won’t get merged without rebasing onto the current alpha build and incorporating the changes that wwqgtxx has made over the past day. There are too many modifications to the existing code responsible for the core XHTTP support. The right approach would be to rework the code using the existing base implementation, and split each new feature into separate PRs — xmux separately, h3 support separately, packet‑up mode separately, and so on.

@HanaKDev

Copy link
Copy Markdown
Author

I think this pull request won’t get merged without rebasing onto the current alpha build and incorporating the changes that wwqgtxx has made over the past day. There are too many modifications to the existing code responsible for the core XHTTP support. The right approach would be to rework the code using the existing base implementation, and split each new feature into separate PRs — xmux separately, h3 support separately, packet‑up mode separately, and so on.

I’m aware that this PR introduces quite a large set of changes. For now it mainly serves as an experimental implementation and a place for testing. If the approach proves workable, I’m open to rebasing it onto the current alpha branch and splitting the functionality into smaller PRs (xmux, H3 support, packet-up mode, etc.) so it’s easier to review and potentially merge. And if upstream ends up implementing similar functionality directly, I’m also happy to learn from that implementation and adjust accordingly.

@HanaKDev HanaKDev marked this pull request as draft March 30, 2026 13:03
@HanaKDev HanaKDev force-pushed the Alpha branch 3 times, most recently from 336bd7c to 5cbe38a Compare March 30, 2026 22:23
@HanaKDev HanaKDev closed this Mar 31, 2026
@bilibili8888

Copy link
Copy Markdown

xhttp-H3 还有戏吗?

@HanaKDev

HanaKDev commented Apr 8, 2026

Copy link
Copy Markdown
Author

xhttp-H3 还有戏吗?

应该已经支持了?

@bilibili8888

Copy link
Copy Markdown

xhttp-H3 还有戏吗?

应该已经支持了?

xhttp-H3 还有戏吗?

应该已经支持了?

image 昨天的最新版也看了,应该是不支持的!

@HanaKDev

HanaKDev commented Apr 8, 2026

Copy link
Copy Markdown
Author

image 昨天的最新版也看了,应该是不支持的!

重新Vibe了个, 也许可以试试

配置文件

proxies:
  - name: test
    alpn: ["h3", "h2", "http/1.1"]
    xhttp-opts:
      host: HOST
      path: PATH
      mode: packet-up
      try-quic: true

mihomo-linux-amd64.zip
mihomo-linux-arm64.zip
mihomo-windows-amd64.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants