Skip to content

chore: improve HTTPS RR logging#2431

Merged
wwqgtxx merged 1 commit intoMetaCubeX:Alphafrom
eric-gitta-moore:Meta
Dec 12, 2025
Merged

chore: improve HTTPS RR logging#2431
wwqgtxx merged 1 commit intoMetaCubeX:Alphafrom
eric-gitta-moore:Meta

Conversation

@eric-gitta-moore
Copy link

@eric-gitta-moore eric-gitta-moore commented Dec 11, 2025

link #2428

  • Add formatHTTPSRRInfo function to parse and format HTTPS RR details
  • Enhance DNS logging to show HTTPS RR details (ALPN, public name, hints)

for example.

mihomo on  Meta [!] via  v1.24.1 on   (auto) took 1m34s at 00:32:34
❯ go run .\main.go -d C:\Users\admin\Downloads\mihomo-windows-amd64-v3-v1.19.17 -f C:\Users\admin\Downloads\mihomo-windows-amd64-v3-v1.19.17\mihoyo-9b68.yaml
time="2025-12-12T00:33:04.887958500+08:00" level=info msg="Start initial configuration in progress"
time="2025-12-12T00:33:04.913846600+08:00" level=info msg="Geodata Loader mode: memconservative"
time="2025-12-12T00:33:04.913846600+08:00" level=info msg="Geosite Matcher implementation: succinct"
time="2025-12-12T00:33:04.943604700+08:00" level=info msg="Initial configuration complete, total time: 30ms"
time="2025-12-12T00:33:04.943604700+08:00" level=info msg="Sniffer is closed"
time="2025-12-12T00:33:04.945494100+08:00" level=info msg="RESTful API listening at: 127.0.0.1:19097"
time="2025-12-12T00:33:04.946035300+08:00" level=info msg="Mixed(http+socks) proxy listening at: 127.0.0.1:7897"
time="2025-12-12T00:33:04.946035300+08:00" level=info msg="Start initial compatible provider default"
time="2025-12-12T00:33:04.946035300+08:00" level=info msg="Start initial compatible provider OUT"
time="2025-12-12T00:33:15.694234400+08:00" level=debug msg="[Rule] use default rules"
time="2025-12-12T00:33:15.694778900+08:00" level=debug msg="[DNS] resolve openai.com A from https://223.5.5.5:443/dns-query"
time="2025-12-12T00:33:15.694778900+08:00" level=debug msg="creating a new http client"
time="2025-12-12T00:33:15.694778900+08:00" level=debug msg="[https://223.5.5.5:443/dns-query] using HTTP/2 for this upstream: <nil>"
time="2025-12-12T00:33:15.694778900+08:00" level=debug msg="[DNS] resolve openai.com A from https://1.12.12.12:443/dns-query"
time="2025-12-12T00:33:15.695325900+08:00" level=debug msg="creating a new http client"
time="2025-12-12T00:33:15.694778900+08:00" level=debug msg="[DNS] resolve openai.com AAAA from https://223.5.5.5:443/dns-query"
time="2025-12-12T00:33:15.694778900+08:00" level=debug msg="[DNS] resolve openai.com AAAA from https://1.12.12.12:443/dns-query"
time="2025-12-12T00:33:15.695325900+08:00" level=debug msg="[https://1.12.12.12:443/dns-query] using HTTP/2 for this upstream: <nil>"
time="2025-12-12T00:33:15.748320800+08:00" level=debug msg="[DNS] openai.com --> [] AAAA from https://223.5.5.5:443/dns-query"
time="2025-12-12T00:33:15.753294300+08:00" level=debug msg="[DNS] openai.com --> [104.18.33.45 172.64.154.211] A from https://223.5.5.5:443/dns-query"
time="2025-12-12T00:33:16.948471400+08:00" level=debug msg="[DNS] resolve example.eu.org HTTPS from https://223.5.5.5:443/dns-query"
time="2025-12-12T00:33:16.948471400+08:00" level=debug msg="[DNS] resolve example.eu.org HTTPS from https://1.12.12.12:443/dns-query"
+time="2025-12-12T00:33:16.954842400+08:00" level=debug msg="[DNS] example.eu.org --> [alpn:h3,h2;pn:cloudflare-ech.com;ipv4hint;ipv6hint] HTTPS from https://223.5.5.5:443/dns-query"
time="2025-12-12T00:33:18.026054100+08:00" level=info msg="[TCP] 127.0.0.1:5289 --> byted.cc:443 match Match using OUT[SG1-openai]"
time="2025-12-12T00:33:25.253409000+08:00" level=debug msg="[Rule] use default rules"
time="2025-12-12T00:33:25.253409000+08:00" level=debug msg="[DNS] cache hit openai.com --> [] AAAA, expire at 2025-12-12 00:35:12"
time="2025-12-12T00:33:25.253409000+08:00" level=debug msg="[DNS] cache hit openai.com --> [104.18.33.45 172.64.154.211] A, expire at 2025-12-12 00:33:20"       
time="2025-12-12T00:33:25.253965300+08:00" level=debug msg="[DNS] resolve openai.com A from https://223.5.5.5:443/dns-query"
time="2025-12-12T00:33:25.253965300+08:00" level=debug msg="[DNS] resolve openai.com A from https://1.12.12.12:443/dns-query"
time="2025-12-12T00:33:25.261854100+08:00" level=debug msg="[DNS] openai.com --> [172.64.154.211 104.18.33.45] A from https://1.12.12.12:443/dns-query"
+time="2025-12-12T00:33:26.445743300+08:00" level=debug msg="[DNS] cache hit example.eu.org --> [alpn:h3,h2;pn:cloudflare-ech.com;ipv4hint;ipv6hint] HTTPS, expire at 2025-12-12 00:35:12"
time="2025-12-12T00:33:27.440355300+08:00" level=info msg="[TCP] 127.0.0.1:7968 --> byted.cc:443 match Match using OUT[SG1-openai]"
time="2025-12-12T00:33:35.123177200+08:00" level=warning msg="Mihomo shutting down"

@eric-gitta-moore
Copy link
Author

@wwqgtxx May I ask if you have any suggestions or comments regarding this PR?

@eric-gitta-moore eric-gitta-moore changed the title feat(dns): improve HTTPS RR logging and add ECH support chore(dns): improve HTTPS RR logging and add ECH support Dec 12, 2025
@wwqgtxx

This comment was marked as resolved.

@wwqgtxx wwqgtxx marked this pull request as draft December 12, 2025 07:20
@wwqgtxx

This comment was marked as resolved.

@wwqgtxx

This comment was marked as resolved.

@wwqgtxx wwqgtxx marked this pull request as ready for review December 12, 2025 09:40
@wwqgtxx wwqgtxx changed the title chore(dns): improve HTTPS RR logging and add ECH support chore: improve HTTPS RR logging Dec 12, 2025
@wwqgtxx wwqgtxx merged commit 7e8c287 into MetaCubeX:Alpha Dec 12, 2025
@wwqgtxx
Copy link
Collaborator

wwqgtxx commented Dec 12, 2025

Although the PR has been merged, I still have some questions:

Why process the data in msg.Extra? This data shouldn't be from our request, right? It might contain answers from other domains.

@eric-gitta-moore
Copy link
Author

@wwqgtxx thx.

👍 Thank you for the reminder. It is indeed possible to omit msg.Extra, but a better approach might be to query msg.Extra again only if no HTTPSRR is found in msg.Answer.

@wwqgtxx
Copy link
Collaborator

wwqgtxx commented Dec 12, 2025

To simplify the problem, let's ignore it for now: e7a04e0

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.

2 participants