Skip to content

Commit 45534fd

Browse files
committed
new: add vay dnstt parser
1 parent f58be84 commit 45534fd

5 files changed

Lines changed: 120 additions & 44 deletions

File tree

go.mod

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ require (
3030
github.com/ameshkov/dnscrypt/v2 v2.4.0 // indirect
3131
github.com/ameshkov/dnsstamps v1.0.3 // indirect
3232
github.com/amnezia-vpn/amneziawg-go v0.2.16 // indirect
33-
github.com/andybalholm/brotli v1.1.1 // indirect
33+
github.com/andybalholm/brotli v1.2.0 // indirect
3434
github.com/anthropics/anthropic-sdk-go v1.19.0 // indirect
3535
github.com/anytls/sing-anytls v0.0.11 // indirect
3636
github.com/armon/go-proxyproto v0.0.0-20180202201750-5b7edb60ff5f // indirect
@@ -59,11 +59,10 @@ require (
5959
github.com/ebitengine/purego v0.9.1 // indirect
6060
github.com/enfein/mieru/v3 v3.27.0 // indirect
6161
github.com/florianl/go-nfqueue/v2 v2.0.2 // indirect
62-
github.com/flynn/noise v1.0.1-0.20220214164934-d803f5c4b0f4 // indirect
62+
github.com/flynn/noise v1.1.0 // indirect
6363
github.com/fsnotify/fsnotify v1.7.0 // indirect
6464
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
6565
github.com/gaissmai/bart v0.18.0 // indirect
66-
github.com/gaukas/godicttls v0.0.4 // indirect
6766
github.com/go-chi/chi/v5 v5.2.3 // indirect
6867
github.com/go-chi/render v1.0.3 // indirect
6968
github.com/go-json-experiment/json v0.0.0-20250813024750-ebf49471dced // indirect
@@ -87,16 +86,15 @@ require (
8786
github.com/jsimonetti/rtnetlink v1.4.0 // indirect
8887
github.com/kamstrup/intmap v0.5.2 // indirect
8988
github.com/keybase/go-keychain v0.0.1 // indirect
90-
github.com/klauspost/compress v1.18.0 // indirect
89+
github.com/klauspost/compress v1.18.3 // indirect
9190
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
92-
github.com/klauspost/reedsolomon v1.12.0 // indirect
91+
github.com/klauspost/reedsolomon v1.13.0 // indirect
9392
github.com/libdns/acmedns v0.5.0 // indirect
9493
github.com/libdns/alidns v1.0.6-beta.3 // indirect
9594
github.com/libdns/cloudflare v0.2.2 // indirect
9695
github.com/libdns/libdns v1.1.1 // indirect
9796
github.com/libp2p/go-reuseport v0.4.0 // indirect
9897
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
99-
github.com/mahsanet/dnstt v0.0.0-20260208072932-d75b50056612 // indirect
10098
github.com/marusama/semaphore v0.0.0-20171214154724-565ffd8e868a // indirect
10199
github.com/mdlayher/netlink v1.7.3-0.20250113171957-fbb4dce95f42 // indirect
102100
github.com/mdlayher/socket v0.5.1 // indirect
@@ -105,6 +103,7 @@ require (
105103
github.com/miekg/dns v1.1.72 // indirect
106104
github.com/mitchellh/go-ps v1.0.0 // indirect
107105
github.com/mroth/weightedrand v1.0.0 // indirect
106+
github.com/net2share/vaydns v0.2.5 // indirect
108107
github.com/openai/openai-go/v3 v3.15.0 // indirect
109108
github.com/pelletier/go-toml v1.9.5 // indirect
110109
github.com/pierrec/lz4/v4 v4.1.21 // indirect
@@ -133,7 +132,7 @@ require (
133132
github.com/refraction-networking/ed25519 v0.1.2 // indirect
134133
github.com/refraction-networking/gotapdance v1.7.10 // indirect
135134
github.com/refraction-networking/obfs4 v0.1.2 // indirect
136-
github.com/refraction-networking/utls v1.3.3 // indirect
135+
github.com/refraction-networking/utls v1.8.2 // indirect
137136
github.com/safchain/ethtool v0.3.0 // indirect
138137
github.com/sagernet/bbolt v0.0.0-20231014093535-ea5cb2fe9f0a // indirect
139138
github.com/sagernet/cors v1.2.1 // indirect
@@ -178,7 +177,7 @@ require (
178177
github.com/sagernet/ws v0.0.0-20231204124109-acfe8907c854 // indirect
179178
github.com/sergeyfrolov/bsbuffer v0.0.0-20180903213811-94e85abb8507 // indirect
180179
github.com/shadowsocks/go-shadowsocks2 v0.1.5 // indirect
181-
github.com/sirupsen/logrus v1.9.3 // indirect
180+
github.com/sirupsen/logrus v1.9.4 // indirect
182181
github.com/spf13/pflag v1.0.9 // indirect
183182
github.com/stretchr/testify v1.11.1 // indirect
184183
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
@@ -200,7 +199,7 @@ require (
200199
github.com/wlynxg/anet v0.0.5 // indirect
201200
github.com/x448/float16 v0.8.4 // indirect
202201
github.com/xtaci/kcp-go/v5 v5.6.70 // indirect
203-
github.com/xtaci/smux v1.5.24 // indirect
202+
github.com/xtaci/smux v1.5.50 // indirect
204203
github.com/zeebo/blake3 v0.2.4 // indirect
205204
gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/goptlib v1.5.0 // indirect
206205
go.uber.org/multierr v1.11.0 // indirect

go.sum

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ github.com/ameshkov/dnsstamps v1.0.3 h1:Srzik+J9mivH1alRACTbys2xOxs0lRH9qnTA7Y1O
4242
github.com/ameshkov/dnsstamps v1.0.3/go.mod h1:Ii3eUu73dx4Vw5O4wjzmT5+lkCwovjzaEZZ4gKyIH5A=
4343
github.com/amnezia-vpn/amneziawg-go v0.2.16 h1:XY6HOq/xtqH8ZXMncRWkjFs85EKdN10NLNnw23kTpE0=
4444
github.com/amnezia-vpn/amneziawg-go v0.2.16/go.mod h1:nRkPpIzjCxMW8pZKXTRkpqAQVlmFJdVOGkeQSC7wbms=
45-
github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA=
46-
github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA=
45+
github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ=
46+
github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
4747
github.com/anthropics/anthropic-sdk-go v1.19.0 h1:mO6E+ffSzLRvR/YUH9KJC0uGw0uV8GjISIuzem//3KE=
4848
github.com/anthropics/anthropic-sdk-go v1.19.0/go.mod h1:WTz31rIUHUHqai2UslPpw5CwXrQP3geYBioRV4WOLvE=
4949
github.com/anytls/sing-anytls v0.0.11 h1:w8e9Uj1oP3m4zxkyZDewPk0EcQbvVxb7Nn+rapEx4fc=
@@ -123,8 +123,8 @@ github.com/florianl/go-nfqueue v1.1.1-0.20200829120558-a2f196e98ab0 h1:7ZJyJV4Ki
123123
github.com/florianl/go-nfqueue v1.1.1-0.20200829120558-a2f196e98ab0/go.mod h1:2z3Tfqwv2ueuK6h563xUHRcCh1mv38wS9EjiWiesk84=
124124
github.com/florianl/go-nfqueue/v2 v2.0.2 h1:FL5lQTeetgpCvac1TRwSfgaXUn0YSO7WzGvWNIp3JPE=
125125
github.com/florianl/go-nfqueue/v2 v2.0.2/go.mod h1:VA09+iPOT43OMoCKNfXHyzujQUty2xmzyCRkBOlmabc=
126-
github.com/flynn/noise v1.0.1-0.20220214164934-d803f5c4b0f4 h1:6pcIWmKkQZdpPjs/pD9OLt0NwftBozNE0Nm5zMCG2C4=
127-
github.com/flynn/noise v1.0.1-0.20220214164934-d803f5c4b0f4/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag=
126+
github.com/flynn/noise v1.1.0 h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg=
127+
github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag=
128128
github.com/frankban/quicktest v1.14.5 h1:dfYrrRyLtiqT9GyKXgdh+k4inNeTvmGbuSgZ3lx3GhA=
129129
github.com/frankban/quicktest v1.14.5/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
130130
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
@@ -133,8 +133,6 @@ github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv
133133
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
134134
github.com/gaissmai/bart v0.18.0 h1:jQLBT/RduJu0pv/tLwXE+xKPgtWJejbxuXAR+wLJafo=
135135
github.com/gaissmai/bart v0.18.0/go.mod h1:JJzMAhNF5Rjo4SF4jWBrANuJfqY+FvsFhW7t1UZJ+XY=
136-
github.com/gaukas/godicttls v0.0.4 h1:NlRaXb3J6hAnTmWdsEKb9bcSBD6BvcIjdGdeb0zfXbk=
137-
github.com/gaukas/godicttls v0.0.4/go.mod h1:l6EenT4TLWgTdwslVb4sEMOCf7Bv0JAK67deKr9/NCI=
138136
github.com/github/fakeca v0.1.0 h1:Km/MVOFvclqxPM9dZBC4+QE564nU4gz4iZ0D9pMw28I=
139137
github.com/github/fakeca v0.1.0/go.mod h1:+bormgoGMMuamOscx7N91aOuUST7wdaJ2rNjeohylyo=
140138
github.com/go-chi/chi/v5 v5.2.3 h1:WQIt9uxdsAbgIYgid+BpYc+liqQZGMHRaUwp0JUcvdE=
@@ -221,12 +219,12 @@ github.com/kamstrup/intmap v0.5.2 h1:qnwBm1mh4XAnW9W9Ue9tZtTff8pS6+s6iKF6JRIV2Dk
221219
github.com/kamstrup/intmap v0.5.2/go.mod h1:gWUVWHKzWj8xpJVFf5GC0O26bWmv3GqdnIX/LMT6Aq4=
222220
github.com/keybase/go-keychain v0.0.1 h1:way+bWYa6lDppZoZcgMbYsvC7GxljxrskdNInRtuthU=
223221
github.com/keybase/go-keychain v0.0.1/go.mod h1:PdEILRW3i9D8JcdM+FmY6RwkHGnhHxXwkPPMeUgOK1k=
224-
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
225-
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
222+
github.com/klauspost/compress v1.18.3 h1:9PJRvfbmTabkOX8moIpXPbMMbYN60bWImDDU7L+/6zw=
223+
github.com/klauspost/compress v1.18.3/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
226224
github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=
227225
github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
228-
github.com/klauspost/reedsolomon v1.12.0 h1:I5FEp3xSwVCcEh3F5A7dofEfhXdF/bWhQWPH+XwBFno=
229-
github.com/klauspost/reedsolomon v1.12.0/go.mod h1:EPLZJeh4l27pUGC3aXOjheaoh1I9yut7xTURiW3LQ9Y=
226+
github.com/klauspost/reedsolomon v1.13.0 h1:E0Cmgf2kMuhZTj6eefnvpKC4/Q4jhCi9YIjcZjK4arc=
227+
github.com/klauspost/reedsolomon v1.13.0/go.mod h1:ggJT9lc71Vu+cSOPBlxGvBN6TfAS77qB4fp8vJ05NSA=
230228
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
231229
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
232230
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
@@ -249,8 +247,6 @@ github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczG
249247
github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
250248
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4=
251249
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
252-
github.com/mahsanet/dnstt v0.0.0-20260208072932-d75b50056612 h1:d4i0AY/0omVj2Rv/WKEWlO1f6EalZpogr148GKhlgrw=
253-
github.com/mahsanet/dnstt v0.0.0-20260208072932-d75b50056612/go.mod h1:8iR4Swlyx+tXtFLrxr/AyHrWd2sAbK326dc7deEPy94=
254250
github.com/marusama/semaphore v0.0.0-20171214154724-565ffd8e868a h1:6SRny9FLB1eWasPyDUqBQnMi9NhXU01XIlB0ao89YoI=
255251
github.com/marusama/semaphore v0.0.0-20171214154724-565ffd8e868a/go.mod h1:TmeOqAKoDinfPfSohs14CO3VcEf7o+Bem6JiNe05yrQ=
256252
github.com/mdlayher/netlink v1.7.3-0.20250113171957-fbb4dce95f42 h1:A1Cq6Ysb0GM0tpKMbdCXCIfBclan4oHk1Jb+Hrejirg=
@@ -267,6 +263,8 @@ github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc
267263
github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg=
268264
github.com/mroth/weightedrand v1.0.0 h1:V8JeHChvl2MP1sAoXq4brElOcza+jxLkRuwvtQu8L3E=
269265
github.com/mroth/weightedrand v1.0.0/go.mod h1:3p2SIcC8al1YMzGhAIoXD+r9olo/g/cdJgAD905gyNE=
266+
github.com/net2share/vaydns v0.2.5 h1:NPok2sOT+R37yVO79JqwZLfBBoAftyx++xtDQXRKQpA=
267+
github.com/net2share/vaydns v0.2.5/go.mod h1:+8kEfQsZJn7/4aIppVekrSuqhrKjGBIgnacTJkdAlS8=
270268
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=
271269
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
272270
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
@@ -276,8 +274,8 @@ github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8=
276274
github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY=
277275
github.com/openai/openai-go/v3 v3.15.0 h1:hk99rM7YPz+M99/5B/zOQcVwFRLLMdprVGx1vaZ8XMo=
278276
github.com/openai/openai-go/v3 v3.15.0/go.mod h1:cdufnVK14cWcT9qA1rRtrXx4FTRsgbDPW7Ia7SS5cZo=
279-
github.com/oschwald/geoip2-golang v1.9.0 h1:uvD3O6fXAXs+usU+UGExshpdP13GAqp4GBrzN7IgKZc=
280-
github.com/oschwald/geoip2-golang v1.9.0/go.mod h1:BHK6TvDyATVQhKNbQBdrj9eAvuwOMi2zSFXizL3K81Y=
277+
github.com/oschwald/geoip2-golang v1.13.0 h1:Q44/Ldc703pasJeP5V9+aFSZFmBN7DKHbNsSFzQATJI=
278+
github.com/oschwald/geoip2-golang v1.13.0/go.mod h1:P9zG+54KPEFOliZ29i7SeYZ/GM6tfEL+rgSn03hYuUo=
281279
github.com/oschwald/maxminddb-golang v1.13.1 h1:G3wwjdN9JmIK2o/ermkHM+98oX5fS+k5MbwsmL4MRQE=
282280
github.com/oschwald/maxminddb-golang v1.13.1/go.mod h1:K4pgV9N/GcK694KSTmVSDTODk4IsCNThNdTmnaBZ/F8=
283281
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
@@ -354,8 +352,8 @@ github.com/refraction-networking/gotapdance v1.7.10 h1:vPtvuihP95SqrnnpX//KI1PTq
354352
github.com/refraction-networking/gotapdance v1.7.10/go.mod h1:N7Xmt+/bLv+1VctiBHtsaL6YBknW2ox5LRLzPTISMzY=
355353
github.com/refraction-networking/obfs4 v0.1.2 h1:J842O4fGSkd2W8ogYj0KN6gqVVY+Cpqodw9qFGL7wVU=
356354
github.com/refraction-networking/obfs4 v0.1.2/go.mod h1:wAl/+gWiLsrcykJA3nKJHx89f5/gXGM8UKvty7+mvbM=
357-
github.com/refraction-networking/utls v1.3.3 h1:f/TBLX7KBciRyFH3bwupp+CE4fzoYKCirhdRcC490sw=
358-
github.com/refraction-networking/utls v1.3.3/go.mod h1:DlecWW1LMlMJu+9qpzzQqdHDT/C2LAe03EdpLUz/RL8=
355+
github.com/refraction-networking/utls v1.8.2 h1:j4Q1gJj0xngdeH+Ox/qND11aEfhpgoEvV+S9iJ2IdQo=
356+
github.com/refraction-networking/utls v1.8.2/go.mod h1:jkSOEkLqn+S/jtpEHPOsVv/4V4EVnelwbMQl4vCWXAM=
359357
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 h1:f/FNXud6gA3MNr8meMVVGxhp+QBTqY91tM8HjEuMjGg=
360358
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3/go.mod h1:HgjTstvQsPGkxUsCd2KWxErBblirPizecHcpD3ffK+s=
361359
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
@@ -459,8 +457,8 @@ github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFt
459457
github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ=
460458
github.com/shtorm-7/dnscrypt/v2 v2.4.0-extended-1.0.0 h1:e5s7RKBd2rIPR0StbvZ2vTVtJ5jDTsTk5wtIIapZTRg=
461459
github.com/shtorm-7/dnscrypt/v2 v2.4.0-extended-1.0.0/go.mod h1:WpEFV2uhebXb8Jhes/5/fSdpmhGV8TL22RDaeWwV6hI=
462-
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
463-
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
460+
github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w=
461+
github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g=
464462
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ=
465463
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
466464
github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=
@@ -531,8 +529,8 @@ github.com/xtaci/kcp-go/v5 v5.6.70 h1:AYX0QZl6PqmNj2IdYGZGuBfZuDUkUfl+eHYNijCqaO
531529
github.com/xtaci/kcp-go/v5 v5.6.70/go.mod h1:9O3D8WR+cyyUjGiTILYfg17vn72otWuXK2AFfqIe6CM=
532530
github.com/xtaci/lossyconn v0.0.0-20190602105132-8df528c0c9ae h1:J0GxkO96kL4WF+AIT3M4mfUVinOCPgf2uUWYFUzN0sM=
533531
github.com/xtaci/lossyconn v0.0.0-20190602105132-8df528c0c9ae/go.mod h1:gXtu8J62kEgmN++bm9BVICuT/e8yiLI2KFobd/TRFsE=
534-
github.com/xtaci/smux v1.5.24 h1:77emW9dtnOxxOQ5ltR+8BbsX1kzcOxQ5gB+aaV9hXOY=
535-
github.com/xtaci/smux v1.5.24/go.mod h1:OMlQbT5vcgl2gb49mFkYo6SMf+zP3rcjcwQz7ZU7IGY=
532+
github.com/xtaci/smux v1.5.50 h1:y/1DlWQC9bnMeZzsyk4oL2hbLK6uVk4BKTz5BeQqUEA=
533+
github.com/xtaci/smux v1.5.50/go.mod h1:IGQ9QYrBphmb/4aTnLEcJby0TNr3NV+OslIOMrX825Q=
536534
github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU=
537535
github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E=
538536
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
@@ -642,7 +640,6 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
642640
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
643641
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
644642
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
645-
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
646643
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
647644
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
648645
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

ray2sing/common.go

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,43 @@ func toInt(s string) int {
448448
return i
449449
}
450450

451+
func toBool(s string, def bool) bool {
452+
switch strings.ToLower(s) {
453+
case "true":
454+
return true
455+
case "1":
456+
return true
457+
case "yes":
458+
return true
459+
case "on":
460+
return true
461+
case "false":
462+
return false
463+
case "0":
464+
return false
465+
case "no":
466+
return false
467+
case "off":
468+
return false
469+
default:
470+
return def
471+
}
472+
}
473+
func toIntN(s string) *int {
474+
i, err := strconv.Atoi(s)
475+
if err != nil {
476+
return nil
477+
}
478+
return &i
479+
}
480+
481+
func toFloatN(s string) *float64 {
482+
i, err := strconv.ParseFloat(s, 64)
483+
if err != nil {
484+
return nil
485+
}
486+
return &i
487+
}
451488
func toUInt16(s string, defaultPort uint16) uint16 {
452489
val, err := strconv.ParseInt(s, 10, 17)
453490
if err != nil {
@@ -483,7 +520,7 @@ func getOneOf(dic map[string]string, headers ...string) (string, error) {
483520

484521
func getOneOfN(dic map[string]string, defaultval string, headers ...string) string {
485522
for _, h := range headers {
486-
if str, ok := dic[h]; ok {
523+
if str, ok := dic[normalizeStr(h)]; ok {
487524
return str
488525
}
489526
}

ray2sing/dnstt.go

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,53 @@ func DnsttSingbox(vlessURL string) (*T.Outbound, error) {
1212
return nil, err
1313
}
1414
decoded := u.Params
15-
uot := T.UDPOverTCPOptions{
16-
Enabled: getOneOfN(decoded, "", "uot") != "false" && getOneOfN(decoded, "", "uot") != "0",
15+
// uot := T.UDPOverTCPOptions{
16+
// Enabled: getOneOfN(decoded, "", "uot") != "false" && getOneOfN(decoded, "", "uot") != "0",
17+
// }
18+
d := &T.DnsttOptions{
19+
DialerOptions: getDialerOptions(decoded),
20+
PublicKey: getOneOfN(decoded, "", "pubkey", "publickey", "serverpublickey"),
21+
Domain: getOneOfN(decoded, "", "domain", "serveraddress", "address"),
22+
Resolvers: strings.Split(getOneOfN(decoded, "", "resolver"), ","),
23+
TunnelPerResolver: toInt(getOneOfN(decoded, "4", "tunnelperresolver")),
24+
25+
PreTestDomain: getOneOfN(decoded, "", "pretest-domain"),
26+
PreTestRecordType: getOneOfN(decoded, "", "pretest-record-type"),
27+
RecordType: getOneOfN(decoded, "", "record-type"),
28+
UTLSClientHelloID: getOneOfN(decoded, "", "utls"),
29+
30+
DnsttCompat: toBool(getOneOfN(decoded, "false", "dnstt-compat")),
31+
ClientIDSize: toIntN(getOneOfN(decoded, "", "clientid-size")),
32+
MaxQnameLen: toIntN(getOneOfN(decoded, "", "max-qname-len")),
33+
MaxNumLabels: toIntN(getOneOfN(decoded, "", "max-num-labels")),
34+
RPS: toFloatN(getOneOfN(decoded, "", "rps")),
35+
36+
MTU: toIntN(getOneOfN(decoded, "0", "mtu")),
37+
38+
MaxStreams: toIntN(getOneOfN(decoded, "", "max-streams")),
39+
40+
// IdleTimeout *badoption.Duration `json:"idle-timeout,omitempty"`
41+
// KeepAlive *badoption.Duration `json:"keepalive,omitempty"`
42+
// OpenStreamTimeout *badoption.Duration `json:"open-stream-timeout,omitempty"`
43+
44+
// ReconnectMinDelay *badoption.Duration `json:"reconnect-min,omitempty"`
45+
// ReconnectMaxDelay *badoption.Duration `json:"reconnect-max,omitempty"`
46+
// SessionCheckInterval *badoption.Duration `json:"session-check-interval,omitempty"`
47+
// HandshakeTimeout *badoption.Duration `json:"handshake-timeout,omitempty"`
48+
// UdpTimeout *badoption.Duration `json:"udp-timeout,omitempty"`
49+
UdpAcceptErrors: toBool(getOneOfN(decoded, "false", "udp-accept-errors"), false),
50+
UdpSharedSocket: toBool(getOneOfN(decoded, "true", "udp-shared-socket"), true),
51+
UdpWorkers: toIntN(getOneOfN(decoded, "", "udp-workers")),
52+
53+
// UDPOverTCP: &uot,
54+
}
55+
56+
if d.ClientIDSize == nil && d.RecordType == "" && getOneOfN(decoded, "", "dnstt-compat") == "" {
57+
d.DnsttCompat = true
1758
}
1859
return &T.Outbound{
19-
Tag: u.Name + "§hide§",
20-
Type: "dnstt",
21-
Options: &T.DnsttOptions{
22-
DialerOptions: getDialerOptions(decoded),
23-
PublicKey: getOneOfN(decoded, "", "pubkey", "publickey", "serverpublickey"),
24-
Domain: getOneOfN(decoded, "", "domain", "serveraddress", "address"),
25-
Resolvers: strings.Split(getOneOfN(decoded, "", "resolver"), ","),
26-
TunnelPerResolver: toInt(getOneOfN(decoded, "4", "tunnel_per_resolver")),
27-
UDPOverTCP: &uot,
28-
},
60+
Tag: u.Name + "§hide§",
61+
Type: "dnstt",
62+
Options: d,
2963
}, nil
3064
}

ray2sing/url_schema.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,21 @@ func ParseUrl(inputURL string, defaultPort uint16) (*UrlSchema, error) {
6262
}
6363

6464
for key, values := range parsedURL.Query() {
65-
data.Params[strings.ReplaceAll(strings.ToLower(key), "_", "")] = strings.Join(values, ",")
65+
data.Params[normalizeStr(key)] = strings.Join(values, ",")
6666
}
6767

6868
return data, nil
6969
}
7070

71+
func normalizeStr(ss string) string {
72+
s := strings.ToLower(strings.TrimSpace(ss))
73+
for _, r := range []string{"_", "-"} {
74+
s = strings.ReplaceAll(s, r, " ")
75+
76+
}
77+
return s
78+
}
79+
7180
func getPassword(u *url.URL) string {
7281
if password, ok := u.User.Password(); ok {
7382
return password

0 commit comments

Comments
 (0)