diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index bd44d025..d68bd252 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -13,8 +13,8 @@ Please verify that you've followed these steps " options: - label: " -确保你使用的是**本仓库**最新的的 clash 或 clash Alpha 版本 -Ensure you are using the latest version of Clash or Clash Premium from **this repository**. +确保你使用的是**本仓库**最新的的 mihomo 或 mihomo Alpha 版本 +Ensure you are using the latest version of Mihomo or Mihomo Alpha from **this repository**. " required: true - label: " @@ -38,14 +38,14 @@ I have read the [documentation](https://wiki.metacubex.one/) and was unable to s " required: true - label: " -这是 Clash 核心的问题,并非我所使用的 Clash 衍生版本(如 OpenClash、KoolClash 等)的特定问题 -This is an issue of the Clash core *per se*, not to the derivatives of Clash, like OpenClash or KoolClash. +这是 Mihomo 核心的问题,并非我所使用的 Mihomo 衍生版本(如 OpenMihomo、KoolMihomo 等)的特定问题 +This is an issue of the Mihomo core *per se*, not to the derivatives of Mihomo, like OpenMihomo or KoolMihomo. " required: true - type: input attributes: - label: Clash version - description: "use `clash -v`" + label: Mihomo version + description: "use `mihomo -v`" validations: required: true - type: dropdown @@ -61,20 +61,20 @@ This is an issue of the Clash core *per se*, not to the derivatives of Clash, li - type: textarea attributes: render: yaml - label: "Clash config" + label: "Mihomo config" description: " -在下方附上 Clash core 配置文件,请确保配置文件中没有敏感信息(比如:服务器地址,密码,端口等) -Paste the Clash core configuration file below, please make sure that there is no sensitive information in the configuration file (e.g., server address/url, password, port) +在下方附上 Mihomo core 配置文件,请确保配置文件中没有敏感信息(比如:服务器地址,密码,端口等) +Paste the Mihomo core configuration file below, please make sure that there is no sensitive information in the configuration file (e.g., server address/url, password, port) " validations: required: true - type: textarea attributes: render: shell - label: Clash log + label: Mihomo log description: " -在下方附上 Clash Core 的日志,log level 使用 DEBUG -Paste the Clash core log below with the log level set to `DEBUG`. +在下方附上 Mihomo Core 的日志,log level 使用 DEBUG +Paste the Mihomo core log below with the log level set to `DEBUG`. " - type: textarea attributes: diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 0cf54628..75d37b63 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: false contact_links: - - name: Clash.Meta Community Support - url: https://github.com/MetaCubeX/Clash.Meta/discussions - about: Please ask and answer questions about Clash.Meta here. + - name: mihomo Community Support + url: https://github.com/MetaCubeX/mihomo/discussions + about: Please ask and answer questions about mihomo here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index a32d313d..7987526c 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -25,7 +25,7 @@ I have read the [documentation](https://wiki.metacubex.one/) and was unable to s - type: textarea attributes: label: Description - description: 请详细、清晰地表达你要提出的论述,例如这个问题如何影响到你?你想实现什么功能?目前 Clash Core 的行为是什麽? + description: 请详细、清晰地表达你要提出的论述,例如这个问题如何影响到你?你想实现什么功能?目前 Mihomo Core 的行为是什麽? validations: required: true - type: textarea diff --git a/.github/rename-cgo.sh b/.github/rename-cgo.sh index a0d736de..2bfdb3c6 100644 --- a/.github/rename-cgo.sh +++ b/.github/rename-cgo.sh @@ -5,25 +5,25 @@ for FILENAME in $FILENAMES do if [[ $FILENAME =~ "darwin-10.16-arm64" ]];then echo "rename darwin-10.16-arm64 $FILENAME" - mv $FILENAME clash.meta-darwin-arm64-cgo + mv $FILENAME mihomo-darwin-arm64-cgo elif [[ $FILENAME =~ "darwin-10.16-amd64" ]];then echo "rename darwin-10.16-amd64 $FILENAME" - mv $FILENAME clash.meta-darwin-amd64-cgo + mv $FILENAME mihomo-darwin-amd64-cgo elif [[ $FILENAME =~ "windows-4.0-386" ]];then echo "rename windows 386 $FILENAME" - mv $FILENAME clash.meta-windows-386-cgo.exe + mv $FILENAME mihomo-windows-386-cgo.exe elif [[ $FILENAME =~ "windows-4.0-amd64" ]];then echo "rename windows amd64 $FILENAME" - mv $FILENAME clash.meta-windows-amd64-cgo.exe - elif [[ $FILENAME =~ "clash.meta-linux-arm-5" ]];then - echo "rename clash.meta-linux-arm-5 $FILENAME" - mv $FILENAME clash.meta-linux-armv5-cgo - elif [[ $FILENAME =~ "clash.meta-linux-arm-6" ]];then - echo "rename clash.meta-linux-arm-6 $FILENAME" - mv $FILENAME clash.meta-linux-armv6-cgo - elif [[ $FILENAME =~ "clash.meta-linux-arm-7" ]];then - echo "rename clash.meta-linux-arm-7 $FILENAME" - mv $FILENAME clash.meta-linux-armv7-cgo + mv $FILENAME mihomo-windows-amd64-cgo.exe + elif [[ $FILENAME =~ "mihomo-linux-arm-5" ]];then + echo "rename mihomo-linux-arm-5 $FILENAME" + mv $FILENAME mihomo-linux-armv5-cgo + elif [[ $FILENAME =~ "mihomo-linux-arm-6" ]];then + echo "rename mihomo-linux-arm-6 $FILENAME" + mv $FILENAME mihomo-linux-armv6-cgo + elif [[ $FILENAME =~ "mihomo-linux-arm-7" ]];then + echo "rename mihomo-linux-arm-7 $FILENAME" + mv $FILENAME mihomo-linux-armv7-cgo elif [[ $FILENAME =~ "linux" ]];then echo "rename linux $FILENAME" mv $FILENAME $FILENAME-cgo diff --git a/.github/workflows/android-branch-auto-sync.yml b/.github/workflows/android-branch-auto-sync.yml index c7ee5eba..fd7c9d66 100644 --- a/.github/workflows/android-branch-auto-sync.yml +++ b/.github/workflows/android-branch-auto-sync.yml @@ -50,8 +50,8 @@ jobs: run: | git push origin android-real --force - # Send "core-updated" to MetaCubeX/ClashMetaForAndroid to trigger update-dependencies - trigger-CMFA-update: + # Send "core-updated" to MetaCubeX/MihomoForAndroid to trigger update-dependencies + trigger-MFA-update: needs: update-dependencies runs-on: ubuntu-latest steps: @@ -63,7 +63,7 @@ jobs: - name: Trigger update-dependencies run: | - curl -X POST https://api.github.com/repos/MetaCubeX/ClashMetaForAndroid/dispatches \ + curl -X POST https://api.github.com/repos/MetaCubeX/MihomoForAndroid/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ -H "Authorization: token ${{ steps.generate-token.outputs.token }}" \ -d '{"event_type": "core-updated"}' \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 57a00f3e..a644f97a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -118,7 +118,7 @@ jobs: - name: Set ENV run: | sudo timedatectl set-timezone "Asia/Shanghai" - echo "NAME=clash.meta" >> $GITHUB_ENV + echo "NAME=mihomo" >> $GITHUB_ENV echo "REPO=${{ github.repository }}" >> $GITHUB_ENV echo "ShortSHA=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV echo "BUILDTIME=$(date)" >> $GITHUB_ENV @@ -128,7 +128,7 @@ jobs: - name: Set ENV run: | echo "TAGS=with_gvisor,with_lwip" >> $GITHUB_ENV - echo "LDFLAGS=-X 'github.com/Dreamacro/clash/constant.Version=${VERSION}' -X 'github.com/Dreamacro/clash/constant.BuildTime=${BUILDTIME}' -w -s -buildid=" >> $GITHUB_ENV + echo "LDFLAGS=-X 'github.com/metacubex/mihomo/constant.Version=${VERSION}' -X 'github.com/metacubex/mihomo/constant.BuildTime=${BUILDTIME}' -w -s -buildid=" >> $GITHUB_ENV shell: bash - name: Setup Go @@ -153,7 +153,7 @@ jobs: - name: Build WithoutCGO if: ${{ matrix.job.type!='WithCGO' }} env: - NAME: Clash.Meta + NAME: mihomo BINDIR: bin run: make -j$(($(nproc) + 1)) ${{ matrix.job.target }} @@ -271,7 +271,7 @@ jobs: Release created at ${{ env.BUILDTIME }} Synchronize ${{ github.ref_name }} branch code updates, keeping only the latest version
- [我应该下载哪个文件? / Which file should I download?](https://github.com/MetaCubeX/Clash.Meta/wiki/FAQ) + [我应该下载哪个文件? / Which file should I download?](https://github.com/MetaCubeX/mihomo/wiki/FAQ) [查看文档 / Docs](https://metacubex.github.io/Meta-Docs/) EOF diff --git a/.golangci.yaml b/.golangci.yaml index f5b67397..1de71ad8 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -11,7 +11,7 @@ linters-settings: custom-order: true sections: - standard - - prefix(github.com/Dreamacro/clash) + - prefix(github.com/metacubex/mihomo) - default staticcheck: go: '1.19' diff --git a/Dockerfile b/Dockerfile index 6c5a91f9..c9cd56b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,25 +3,25 @@ ARG TARGETPLATFORM RUN echo "I'm building for $TARGETPLATFORM" RUN apk add --no-cache gzip && \ - mkdir /clash-config && \ - wget -O /clash-config/geoip.metadb https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.metadb && \ - wget -O /clash-config/geosite.dat https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite.dat && \ - wget -O /clash-config/geoip.dat https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.dat + mkdir /mihomo-config && \ + wget -O /mihomo-config/geoip.metadb https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.metadb && \ + wget -O /mihomo-config/geosite.dat https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite.dat && \ + wget -O /mihomo-config/geoip.dat https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.dat -COPY docker/file-name.sh /clash/file-name.sh -WORKDIR /clash +COPY docker/file-name.sh /mihomo/file-name.sh +WORKDIR /mihomo COPY bin/ bin/ RUN FILE_NAME=`sh file-name.sh` && echo $FILE_NAME && \ FILE_NAME=`ls bin/ | egrep "$FILE_NAME.*"|awk NR==1` && echo $FILE_NAME && \ - mv bin/$FILE_NAME clash.gz && gzip -d clash.gz && echo "$FILE_NAME" > /clash-config/test + mv bin/$FILE_NAME mihomo.gz && gzip -d mihomo.gz && echo "$FILE_NAME" > /mihomo-config/test FROM alpine:latest -LABEL org.opencontainers.image.source="https://github.com/MetaCubeX/Clash.Meta" +LABEL org.opencontainers.image.source="https://github.com/MetaCubeX/mihomo" RUN apk add --no-cache ca-certificates tzdata iptables -VOLUME ["/root/.config/clash/"] +VOLUME ["/root/.config/mihomo/"] -COPY --from=builder /clash-config/ /root/.config/clash/ -COPY --from=builder /clash/clash /clash -RUN chmod +x /clash -ENTRYPOINT [ "/clash" ] +COPY --from=builder /mihomo-config/ /root/.config/mihomo/ +COPY --from=builder /mihomo/mihomo /mihomo +RUN chmod +x /mihomo +ENTRYPOINT [ "/mihomo" ] diff --git a/Makefile b/Makefile index 028b986c..f6ffcae5 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -NAME=clash.meta +NAME=mihomo BINDIR=bin BRANCH=$(shell git branch --show-current) ifeq ($(BRANCH),Alpha) @@ -12,8 +12,8 @@ VERSION=$(shell git rev-parse --short HEAD) endif BUILDTIME=$(shell date -u) -GOBUILD=CGO_ENABLED=0 go build -tags with_gvisor -trimpath -ldflags '-X "github.com/Dreamacro/clash/constant.Version=$(VERSION)" \ - -X "github.com/Dreamacro/clash/constant.BuildTime=$(BUILDTIME)" \ +GOBUILD=CGO_ENABLED=0 go build -tags with_gvisor -trimpath -ldflags '-X "github.com/metacubex/mihomo/constant.Version=$(VERSION)" \ + -X "github.com/metacubex/mihomo/constant.BuildTime=$(BUILDTIME)" \ -w -s -buildid=' PLATFORM_LIST = \ diff --git a/README.md b/README.md index d5022dfb..8c82536c 100644 --- a/README.md +++ b/README.md @@ -3,17 +3,17 @@
Meta Kernel
-

Another Clash Kernel.

+

Another Mihomo Kernel.

- - + + - - - + + + - +

@@ -27,7 +27,7 @@ - Remote groups allow users to implement powerful rules. Supports automatic fallback, load balancing or auto select node based off latency - Remote providers, allowing users to get node lists remotely instead of hard-coding in config -- Netfilter TCP redirecting. Deploy Clash on your Internet gateway with `iptables`. +- Netfilter TCP redirecting. Deploy Mihomo on your Internet gateway with `iptables`. - Comprehensive HTTP RESTful API controller ## Dashboard @@ -36,22 +36,22 @@ A web dashboard with first-class support for this project has been created; it c ## Configration example -Configuration example is located at [/docs/config.yaml](https://github.com/MetaCubeX/Clash.Meta/blob/Alpha/docs/config.yaml). +Configuration example is located at [/docs/config.yaml](https://github.com/MetaCubeX/mihomo/blob/Alpha/docs/config.yaml). ## Docs -Documentation can be found in [Clash.Meta Docs](https://clash-meta.wiki). +Documentation can be found in [mihomo Docs](https://wiki.metacubex.one/). ## For development Requirements: [Go 1.20 or newer](https://go.dev/dl/) -Build Clash.Meta: +Build mihomo: ```shell -git clone https://github.com/MetaCubeX/Clash.Meta.git -cd Clash.Meta && go mod download +git clone https://github.com/MetaCubeX/mihomo.git +cd mihomo && go mod download go build ``` @@ -98,4 +98,4 @@ API. This software is released under the GPL-3.0 license. -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FDreamacro%2Fclash.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FDreamacro%2Fclash?ref=badge_large) +[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FMetaCubeX%2Fmihomo.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FMetaCubeX%2Fmihomo?ref=badge_large) diff --git a/adapter/adapter.go b/adapter/adapter.go index 62941e6d..74b11bd9 100644 --- a/adapter/adapter.go +++ b/adapter/adapter.go @@ -12,12 +12,12 @@ import ( "strconv" "time" - "github.com/Dreamacro/clash/common/atomic" - "github.com/Dreamacro/clash/common/queue" - "github.com/Dreamacro/clash/common/utils" - "github.com/Dreamacro/clash/component/dialer" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/common/atomic" + "github.com/metacubex/mihomo/common/queue" + "github.com/metacubex/mihomo/common/utils" + "github.com/metacubex/mihomo/component/dialer" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" "github.com/puzpuzpuz/xsync/v2" ) diff --git a/adapter/inbound/addition.go b/adapter/inbound/addition.go index df03b84a..a9896c8c 100644 --- a/adapter/inbound/addition.go +++ b/adapter/inbound/addition.go @@ -3,7 +3,7 @@ package inbound import ( "net" - C "github.com/Dreamacro/clash/constant" + C "github.com/metacubex/mihomo/constant" ) type Addition func(metadata *C.Metadata) diff --git a/adapter/inbound/auth.go b/adapter/inbound/auth.go index 4022659f..984c9bd6 100644 --- a/adapter/inbound/auth.go +++ b/adapter/inbound/auth.go @@ -4,7 +4,7 @@ import ( "net" "net/netip" - C "github.com/Dreamacro/clash/constant" + C "github.com/metacubex/mihomo/constant" ) var skipAuthPrefixes []netip.Prefix diff --git a/adapter/inbound/http.go b/adapter/inbound/http.go index 7f3b143f..137e17d3 100644 --- a/adapter/inbound/http.go +++ b/adapter/inbound/http.go @@ -3,8 +3,8 @@ package inbound import ( "net" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/socks5" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/socks5" ) // NewHTTP receive normal http request and return HTTPContext diff --git a/adapter/inbound/https.go b/adapter/inbound/https.go index 891ac9e7..55f6731a 100644 --- a/adapter/inbound/https.go +++ b/adapter/inbound/https.go @@ -4,7 +4,7 @@ import ( "net" "net/http" - C "github.com/Dreamacro/clash/constant" + C "github.com/metacubex/mihomo/constant" ) // NewHTTPS receive CONNECT request and return ConnContext diff --git a/adapter/inbound/packet.go b/adapter/inbound/packet.go index 0e3f6c48..7e245f98 100644 --- a/adapter/inbound/packet.go +++ b/adapter/inbound/packet.go @@ -1,8 +1,8 @@ package inbound import ( - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/socks5" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/socks5" ) // NewPacket is PacketAdapter generator diff --git a/adapter/inbound/socket.go b/adapter/inbound/socket.go index 21cb490b..8cd301f7 100644 --- a/adapter/inbound/socket.go +++ b/adapter/inbound/socket.go @@ -3,8 +3,8 @@ package inbound import ( "net" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/socks5" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/socks5" ) // NewSocket receive TCP inbound and return ConnContext diff --git a/adapter/inbound/util.go b/adapter/inbound/util.go index acae7c3e..743337fc 100644 --- a/adapter/inbound/util.go +++ b/adapter/inbound/util.go @@ -7,9 +7,9 @@ import ( "strconv" "strings" - "github.com/Dreamacro/clash/common/nnip" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/common/nnip" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/socks5" ) func parseSocksAddr(target socks5.Addr) *C.Metadata { diff --git a/adapter/outbound/base.go b/adapter/outbound/base.go index ba991bfc..ae8c4651 100644 --- a/adapter/outbound/base.go +++ b/adapter/outbound/base.go @@ -7,10 +7,10 @@ import ( "strings" "syscall" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/utils" - "github.com/Dreamacro/clash/component/dialer" - C "github.com/Dreamacro/clash/constant" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/utils" + "github.com/metacubex/mihomo/component/dialer" + C "github.com/metacubex/mihomo/constant" ) type Base struct { diff --git a/adapter/outbound/direct.go b/adapter/outbound/direct.go index 75e999a6..b9b9fefc 100644 --- a/adapter/outbound/direct.go +++ b/adapter/outbound/direct.go @@ -5,10 +5,10 @@ import ( "errors" "net/netip" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/resolver" - C "github.com/Dreamacro/clash/constant" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/resolver" + C "github.com/metacubex/mihomo/constant" ) type Direct struct { diff --git a/adapter/outbound/http.go b/adapter/outbound/http.go index 19074bb3..b837e49a 100644 --- a/adapter/outbound/http.go +++ b/adapter/outbound/http.go @@ -13,11 +13,11 @@ import ( "net/http" "strconv" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/component/ca" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/proxydialer" - C "github.com/Dreamacro/clash/constant" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/component/ca" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/proxydialer" + C "github.com/metacubex/mihomo/constant" ) type Http struct { diff --git a/adapter/outbound/hysteria.go b/adapter/outbound/hysteria.go index 5a41274c..dacffd10 100644 --- a/adapter/outbound/hysteria.go +++ b/adapter/outbound/hysteria.go @@ -14,17 +14,17 @@ import ( "github.com/metacubex/quic-go/congestion" M "github.com/sagernet/sing/common/metadata" - "github.com/Dreamacro/clash/component/ca" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/proxydialer" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" - hyCongestion "github.com/Dreamacro/clash/transport/hysteria/congestion" - "github.com/Dreamacro/clash/transport/hysteria/core" - "github.com/Dreamacro/clash/transport/hysteria/obfs" - "github.com/Dreamacro/clash/transport/hysteria/pmtud_fix" - "github.com/Dreamacro/clash/transport/hysteria/transport" - "github.com/Dreamacro/clash/transport/hysteria/utils" + "github.com/metacubex/mihomo/component/ca" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/proxydialer" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" + hyCongestion "github.com/metacubex/mihomo/transport/hysteria/congestion" + "github.com/metacubex/mihomo/transport/hysteria/core" + "github.com/metacubex/mihomo/transport/hysteria/obfs" + "github.com/metacubex/mihomo/transport/hysteria/pmtud_fix" + "github.com/metacubex/mihomo/transport/hysteria/transport" + "github.com/metacubex/mihomo/transport/hysteria/utils" ) const ( diff --git a/adapter/outbound/hysteria2.go b/adapter/outbound/hysteria2.go index 6ed4cd8c..ddd5ccea 100644 --- a/adapter/outbound/hysteria2.go +++ b/adapter/outbound/hysteria2.go @@ -9,12 +9,12 @@ import ( "runtime" "strconv" - CN "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/component/ca" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/proxydialer" - C "github.com/Dreamacro/clash/constant" - tuicCommon "github.com/Dreamacro/clash/transport/tuic/common" + CN "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/component/ca" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/proxydialer" + C "github.com/metacubex/mihomo/constant" + tuicCommon "github.com/metacubex/mihomo/transport/tuic/common" "github.com/metacubex/sing-quic/hysteria2" diff --git a/adapter/outbound/reality.go b/adapter/outbound/reality.go index 23314e5f..766138da 100644 --- a/adapter/outbound/reality.go +++ b/adapter/outbound/reality.go @@ -5,7 +5,7 @@ import ( "encoding/hex" "errors" - tlsC "github.com/Dreamacro/clash/component/tls" + tlsC "github.com/metacubex/mihomo/component/tls" "golang.org/x/crypto/curve25519" ) diff --git a/adapter/outbound/reject.go b/adapter/outbound/reject.go index f1de3981..5625f932 100644 --- a/adapter/outbound/reject.go +++ b/adapter/outbound/reject.go @@ -6,9 +6,9 @@ import ( "net" "time" - "github.com/Dreamacro/clash/common/buf" - "github.com/Dreamacro/clash/component/dialer" - C "github.com/Dreamacro/clash/constant" + "github.com/metacubex/mihomo/common/buf" + "github.com/metacubex/mihomo/component/dialer" + C "github.com/metacubex/mihomo/constant" ) type Reject struct { diff --git a/adapter/outbound/shadowsocks.go b/adapter/outbound/shadowsocks.go index 1ae16c43..ffc72abb 100644 --- a/adapter/outbound/shadowsocks.go +++ b/adapter/outbound/shadowsocks.go @@ -7,16 +7,16 @@ import ( "net" "strconv" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/structure" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/proxydialer" - "github.com/Dreamacro/clash/component/resolver" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/restls" - obfs "github.com/Dreamacro/clash/transport/simple-obfs" - shadowtls "github.com/Dreamacro/clash/transport/sing-shadowtls" - v2rayObfs "github.com/Dreamacro/clash/transport/v2ray-plugin" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/structure" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/proxydialer" + "github.com/metacubex/mihomo/component/resolver" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/restls" + obfs "github.com/metacubex/mihomo/transport/simple-obfs" + shadowtls "github.com/metacubex/mihomo/transport/sing-shadowtls" + v2rayObfs "github.com/metacubex/mihomo/transport/v2ray-plugin" restlsC "github.com/3andne/restls-client-go" shadowsocks "github.com/metacubex/sing-shadowsocks2" diff --git a/adapter/outbound/shadowsocksr.go b/adapter/outbound/shadowsocksr.go index 0f03f86d..07d78047 100644 --- a/adapter/outbound/shadowsocksr.go +++ b/adapter/outbound/shadowsocksr.go @@ -7,16 +7,16 @@ import ( "net" "strconv" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/proxydialer" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/shadowsocks/core" - "github.com/Dreamacro/clash/transport/shadowsocks/shadowaead" - "github.com/Dreamacro/clash/transport/shadowsocks/shadowstream" - "github.com/Dreamacro/clash/transport/socks5" - "github.com/Dreamacro/clash/transport/ssr/obfs" - "github.com/Dreamacro/clash/transport/ssr/protocol" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/proxydialer" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/shadowsocks/core" + "github.com/metacubex/mihomo/transport/shadowsocks/shadowaead" + "github.com/metacubex/mihomo/transport/shadowsocks/shadowstream" + "github.com/metacubex/mihomo/transport/socks5" + "github.com/metacubex/mihomo/transport/ssr/obfs" + "github.com/metacubex/mihomo/transport/ssr/protocol" ) type ShadowSocksR struct { @@ -125,7 +125,7 @@ func (ssr *ShadowSocksR) SupportWithDialer() C.NetWork { func NewShadowSocksR(option ShadowSocksROption) (*ShadowSocksR, error) { // SSR protocol compatibility - // https://github.com/Dreamacro/clash/pull/2056 + // https://github.com/metacubex/mihomo/pull/2056 if option.Cipher == "none" { option.Cipher = "dummy" } diff --git a/adapter/outbound/singmux.go b/adapter/outbound/singmux.go index fb6b1c29..dff1e8eb 100644 --- a/adapter/outbound/singmux.go +++ b/adapter/outbound/singmux.go @@ -5,11 +5,11 @@ import ( "errors" "runtime" - CN "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/proxydialer" - "github.com/Dreamacro/clash/component/resolver" - C "github.com/Dreamacro/clash/constant" + CN "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/proxydialer" + "github.com/metacubex/mihomo/component/resolver" + C "github.com/metacubex/mihomo/constant" mux "github.com/sagernet/sing-mux" E "github.com/sagernet/sing/common/exceptions" diff --git a/adapter/outbound/snell.go b/adapter/outbound/snell.go index 16405fcf..76ed4be9 100644 --- a/adapter/outbound/snell.go +++ b/adapter/outbound/snell.go @@ -6,13 +6,13 @@ import ( "net" "strconv" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/structure" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/proxydialer" - C "github.com/Dreamacro/clash/constant" - obfs "github.com/Dreamacro/clash/transport/simple-obfs" - "github.com/Dreamacro/clash/transport/snell" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/structure" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/proxydialer" + C "github.com/metacubex/mihomo/constant" + obfs "github.com/metacubex/mihomo/transport/simple-obfs" + "github.com/metacubex/mihomo/transport/snell" ) type Snell struct { diff --git a/adapter/outbound/socks5.go b/adapter/outbound/socks5.go index 43dfe8ef..c17ee6a7 100644 --- a/adapter/outbound/socks5.go +++ b/adapter/outbound/socks5.go @@ -10,12 +10,12 @@ import ( "net/netip" "strconv" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/component/ca" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/proxydialer" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/socks5" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/component/ca" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/proxydialer" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/socks5" ) type Socks5 struct { diff --git a/adapter/outbound/trojan.go b/adapter/outbound/trojan.go index d3c14e8a..cd1dd28c 100644 --- a/adapter/outbound/trojan.go +++ b/adapter/outbound/trojan.go @@ -8,14 +8,14 @@ import ( "net/http" "strconv" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/component/ca" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/proxydialer" - tlsC "github.com/Dreamacro/clash/component/tls" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/gun" - "github.com/Dreamacro/clash/transport/trojan" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/component/ca" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/proxydialer" + tlsC "github.com/metacubex/mihomo/component/tls" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/gun" + "github.com/metacubex/mihomo/transport/trojan" ) type Trojan struct { diff --git a/adapter/outbound/tuic.go b/adapter/outbound/tuic.go index 93e49dc7..666e72fa 100644 --- a/adapter/outbound/tuic.go +++ b/adapter/outbound/tuic.go @@ -10,12 +10,12 @@ import ( "strconv" "time" - "github.com/Dreamacro/clash/component/ca" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/proxydialer" - "github.com/Dreamacro/clash/component/resolver" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/tuic" + "github.com/metacubex/mihomo/component/ca" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/proxydialer" + "github.com/metacubex/mihomo/component/resolver" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/tuic" "github.com/gofrs/uuid/v5" "github.com/metacubex/quic-go" diff --git a/adapter/outbound/util.go b/adapter/outbound/util.go index b048cd8b..ce9e5f65 100644 --- a/adapter/outbound/util.go +++ b/adapter/outbound/util.go @@ -11,9 +11,9 @@ import ( "strconv" "sync" - "github.com/Dreamacro/clash/component/resolver" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/component/resolver" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/socks5" ) var ( diff --git a/adapter/outbound/vless.go b/adapter/outbound/vless.go index 5f54153b..dbe8b1a4 100644 --- a/adapter/outbound/vless.go +++ b/adapter/outbound/vless.go @@ -12,20 +12,20 @@ import ( "strconv" "sync" - "github.com/Dreamacro/clash/common/convert" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/utils" - "github.com/Dreamacro/clash/component/ca" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/proxydialer" - "github.com/Dreamacro/clash/component/resolver" - tlsC "github.com/Dreamacro/clash/component/tls" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" - "github.com/Dreamacro/clash/transport/gun" - "github.com/Dreamacro/clash/transport/socks5" - "github.com/Dreamacro/clash/transport/vless" - "github.com/Dreamacro/clash/transport/vmess" + "github.com/metacubex/mihomo/common/convert" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/utils" + "github.com/metacubex/mihomo/component/ca" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/proxydialer" + "github.com/metacubex/mihomo/component/resolver" + tlsC "github.com/metacubex/mihomo/component/tls" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/transport/gun" + "github.com/metacubex/mihomo/transport/socks5" + "github.com/metacubex/mihomo/transport/vless" + "github.com/metacubex/mihomo/transport/vmess" vmessSing "github.com/metacubex/sing-vmess" "github.com/metacubex/sing-vmess/packetaddr" diff --git a/adapter/outbound/vmess.go b/adapter/outbound/vmess.go index aed61aa3..8811fb0d 100644 --- a/adapter/outbound/vmess.go +++ b/adapter/outbound/vmess.go @@ -11,17 +11,17 @@ import ( "strings" "sync" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/utils" - "github.com/Dreamacro/clash/component/ca" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/proxydialer" - "github.com/Dreamacro/clash/component/resolver" - tlsC "github.com/Dreamacro/clash/component/tls" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/ntp" - "github.com/Dreamacro/clash/transport/gun" - clashVMess "github.com/Dreamacro/clash/transport/vmess" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/utils" + "github.com/metacubex/mihomo/component/ca" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/proxydialer" + "github.com/metacubex/mihomo/component/resolver" + tlsC "github.com/metacubex/mihomo/component/tls" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/ntp" + "github.com/metacubex/mihomo/transport/gun" + mihomoVMess "github.com/metacubex/mihomo/transport/vmess" vmess "github.com/metacubex/sing-vmess" "github.com/metacubex/sing-vmess/packetaddr" @@ -105,7 +105,7 @@ func (v *Vmess) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.M switch v.option.Network { case "ws": host, port, _ := net.SplitHostPort(v.addr) - wsOpts := &clashVMess.WebsocketConfig{ + wsOpts := &mihomoVMess.WebsocketConfig{ Host: host, Port: port, Path: v.option.WSOpts.Path, @@ -141,12 +141,12 @@ func (v *Vmess) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.M wsOpts.TLSConfig.ServerName = host } } - c, err = clashVMess.StreamWebsocketConn(ctx, c, wsOpts) + c, err = mihomoVMess.StreamWebsocketConn(ctx, c, wsOpts) case "http": // readability first, so just copy default TLS logic if v.option.TLS { host, _, _ := net.SplitHostPort(v.addr) - tlsOpts := &clashVMess.TLSConfig{ + tlsOpts := &mihomoVMess.TLSConfig{ Host: host, SkipCertVerify: v.option.SkipCertVerify, ClientFingerprint: v.option.ClientFingerprint, @@ -157,24 +157,24 @@ func (v *Vmess) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.M if v.option.ServerName != "" { tlsOpts.Host = v.option.ServerName } - c, err = clashVMess.StreamTLSConn(ctx, c, tlsOpts) + c, err = mihomoVMess.StreamTLSConn(ctx, c, tlsOpts) if err != nil { return nil, err } } host, _, _ := net.SplitHostPort(v.addr) - httpOpts := &clashVMess.HTTPConfig{ + httpOpts := &mihomoVMess.HTTPConfig{ Host: host, Method: v.option.HTTPOpts.Method, Path: v.option.HTTPOpts.Path, Headers: v.option.HTTPOpts.Headers, } - c = clashVMess.StreamHTTPConn(c, httpOpts) + c = mihomoVMess.StreamHTTPConn(c, httpOpts) case "h2": host, _, _ := net.SplitHostPort(v.addr) - tlsOpts := clashVMess.TLSConfig{ + tlsOpts := mihomoVMess.TLSConfig{ Host: host, SkipCertVerify: v.option.SkipCertVerify, NextProtos: []string{"h2"}, @@ -186,24 +186,24 @@ func (v *Vmess) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.M tlsOpts.Host = v.option.ServerName } - c, err = clashVMess.StreamTLSConn(ctx, c, &tlsOpts) + c, err = mihomoVMess.StreamTLSConn(ctx, c, &tlsOpts) if err != nil { return nil, err } - h2Opts := &clashVMess.H2Config{ + h2Opts := &mihomoVMess.H2Config{ Hosts: v.option.HTTP2Opts.Host, Path: v.option.HTTP2Opts.Path, } - c, err = clashVMess.StreamH2Conn(c, h2Opts) + c, err = mihomoVMess.StreamH2Conn(c, h2Opts) case "grpc": c, err = gun.StreamGunWithConn(c, v.gunTLSConfig, v.gunConfig, v.realityConfig) default: // handle TLS if v.option.TLS { host, _, _ := net.SplitHostPort(v.addr) - tlsOpts := &clashVMess.TLSConfig{ + tlsOpts := &mihomoVMess.TLSConfig{ Host: host, SkipCertVerify: v.option.SkipCertVerify, ClientFingerprint: v.option.ClientFingerprint, @@ -215,7 +215,7 @@ func (v *Vmess) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.M tlsOpts.Host = v.option.ServerName } - c, err = clashVMess.StreamTLSConn(ctx, c, tlsOpts) + c, err = mihomoVMess.StreamTLSConn(ctx, c, tlsOpts) } } diff --git a/adapter/outbound/wireguard.go b/adapter/outbound/wireguard.go index 6a11a234..9af1751b 100644 --- a/adapter/outbound/wireguard.go +++ b/adapter/outbound/wireguard.go @@ -13,13 +13,13 @@ import ( "strings" "sync" - CN "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/proxydialer" - "github.com/Dreamacro/clash/component/resolver" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/dns" - "github.com/Dreamacro/clash/log" + CN "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/proxydialer" + "github.com/metacubex/mihomo/component/resolver" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/dns" + "github.com/metacubex/mihomo/log" wireguard "github.com/metacubex/sing-wireguard" diff --git a/adapter/outboundgroup/fallback.go b/adapter/outboundgroup/fallback.go index 899b9a9b..d0dd98b1 100644 --- a/adapter/outboundgroup/fallback.go +++ b/adapter/outboundgroup/fallback.go @@ -6,13 +6,13 @@ import ( "errors" "time" - "github.com/Dreamacro/clash/adapter/outbound" - "github.com/Dreamacro/clash/common/callback" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/utils" - "github.com/Dreamacro/clash/component/dialer" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/constant/provider" + "github.com/metacubex/mihomo/adapter/outbound" + "github.com/metacubex/mihomo/common/callback" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/utils" + "github.com/metacubex/mihomo/component/dialer" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/constant/provider" ) type Fallback struct { diff --git a/adapter/outboundgroup/groupbase.go b/adapter/outboundgroup/groupbase.go index 22dd407b..d4a812f6 100644 --- a/adapter/outboundgroup/groupbase.go +++ b/adapter/outboundgroup/groupbase.go @@ -7,14 +7,14 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/adapter/outbound" - "github.com/Dreamacro/clash/common/atomic" - "github.com/Dreamacro/clash/common/utils" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/constant/provider" - types "github.com/Dreamacro/clash/constant/provider" - "github.com/Dreamacro/clash/log" - "github.com/Dreamacro/clash/tunnel" + "github.com/metacubex/mihomo/adapter/outbound" + "github.com/metacubex/mihomo/common/atomic" + "github.com/metacubex/mihomo/common/utils" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/constant/provider" + types "github.com/metacubex/mihomo/constant/provider" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/tunnel" "github.com/dlclark/regexp2" ) diff --git a/adapter/outboundgroup/loadbalance.go b/adapter/outboundgroup/loadbalance.go index e336c5f0..885aeaee 100644 --- a/adapter/outboundgroup/loadbalance.go +++ b/adapter/outboundgroup/loadbalance.go @@ -9,14 +9,14 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/adapter/outbound" - "github.com/Dreamacro/clash/common/cache" - "github.com/Dreamacro/clash/common/callback" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/utils" - "github.com/Dreamacro/clash/component/dialer" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/constant/provider" + "github.com/metacubex/mihomo/adapter/outbound" + "github.com/metacubex/mihomo/common/cache" + "github.com/metacubex/mihomo/common/callback" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/utils" + "github.com/metacubex/mihomo/component/dialer" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/constant/provider" "golang.org/x/net/publicsuffix" ) diff --git a/adapter/outboundgroup/parser.go b/adapter/outboundgroup/parser.go index a8bdc557..8f3335d8 100644 --- a/adapter/outboundgroup/parser.go +++ b/adapter/outboundgroup/parser.go @@ -5,12 +5,12 @@ import ( "fmt" "strings" - "github.com/Dreamacro/clash/adapter/outbound" - "github.com/Dreamacro/clash/adapter/provider" - "github.com/Dreamacro/clash/common/structure" - "github.com/Dreamacro/clash/common/utils" - C "github.com/Dreamacro/clash/constant" - types "github.com/Dreamacro/clash/constant/provider" + "github.com/metacubex/mihomo/adapter/outbound" + "github.com/metacubex/mihomo/adapter/provider" + "github.com/metacubex/mihomo/common/structure" + "github.com/metacubex/mihomo/common/utils" + C "github.com/metacubex/mihomo/constant" + types "github.com/metacubex/mihomo/constant/provider" ) var ( diff --git a/adapter/outboundgroup/relay.go b/adapter/outboundgroup/relay.go index ba733616..2b1be8a5 100644 --- a/adapter/outboundgroup/relay.go +++ b/adapter/outboundgroup/relay.go @@ -3,11 +3,11 @@ package outboundgroup import ( "context" "encoding/json" - "github.com/Dreamacro/clash/adapter/outbound" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/proxydialer" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/constant/provider" + "github.com/metacubex/mihomo/adapter/outbound" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/proxydialer" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/constant/provider" ) type Relay struct { diff --git a/adapter/outboundgroup/selector.go b/adapter/outboundgroup/selector.go index 96934f0c..4d06c544 100644 --- a/adapter/outboundgroup/selector.go +++ b/adapter/outboundgroup/selector.go @@ -5,10 +5,10 @@ import ( "encoding/json" "errors" - "github.com/Dreamacro/clash/adapter/outbound" - "github.com/Dreamacro/clash/component/dialer" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/constant/provider" + "github.com/metacubex/mihomo/adapter/outbound" + "github.com/metacubex/mihomo/component/dialer" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/constant/provider" ) type Selector struct { diff --git a/adapter/outboundgroup/urltest.go b/adapter/outboundgroup/urltest.go index 3f6c6ab0..8c861768 100644 --- a/adapter/outboundgroup/urltest.go +++ b/adapter/outboundgroup/urltest.go @@ -6,13 +6,13 @@ import ( "errors" "time" - "github.com/Dreamacro/clash/adapter/outbound" - "github.com/Dreamacro/clash/common/callback" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/singledo" - "github.com/Dreamacro/clash/component/dialer" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/constant/provider" + "github.com/metacubex/mihomo/adapter/outbound" + "github.com/metacubex/mihomo/common/callback" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/singledo" + "github.com/metacubex/mihomo/component/dialer" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/constant/provider" ) type urlTestOption func(*URLTest) diff --git a/adapter/parser.go b/adapter/parser.go index 43ebfe5f..1d363c1f 100644 --- a/adapter/parser.go +++ b/adapter/parser.go @@ -3,11 +3,11 @@ package adapter import ( "fmt" - tlsC "github.com/Dreamacro/clash/component/tls" + tlsC "github.com/metacubex/mihomo/component/tls" - "github.com/Dreamacro/clash/adapter/outbound" - "github.com/Dreamacro/clash/common/structure" - C "github.com/Dreamacro/clash/constant" + "github.com/metacubex/mihomo/adapter/outbound" + "github.com/metacubex/mihomo/common/structure" + C "github.com/metacubex/mihomo/constant" ) func ParseProxy(mapping map[string]any) (C.Proxy, error) { diff --git a/adapter/provider/healthcheck.go b/adapter/provider/healthcheck.go index feb972ab..e7f021e1 100644 --- a/adapter/provider/healthcheck.go +++ b/adapter/provider/healthcheck.go @@ -6,12 +6,12 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/common/atomic" - "github.com/Dreamacro/clash/common/batch" - "github.com/Dreamacro/clash/common/singledo" - "github.com/Dreamacro/clash/common/utils" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/common/atomic" + "github.com/metacubex/mihomo/common/batch" + "github.com/metacubex/mihomo/common/singledo" + "github.com/metacubex/mihomo/common/utils" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" "github.com/dlclark/regexp2" ) diff --git a/adapter/provider/parser.go b/adapter/provider/parser.go index d885a546..321380ed 100644 --- a/adapter/provider/parser.go +++ b/adapter/provider/parser.go @@ -5,11 +5,11 @@ import ( "fmt" "time" - "github.com/Dreamacro/clash/common/structure" - "github.com/Dreamacro/clash/common/utils" - "github.com/Dreamacro/clash/component/resource" - C "github.com/Dreamacro/clash/constant" - types "github.com/Dreamacro/clash/constant/provider" + "github.com/metacubex/mihomo/common/structure" + "github.com/metacubex/mihomo/common/utils" + "github.com/metacubex/mihomo/component/resource" + C "github.com/metacubex/mihomo/constant" + types "github.com/metacubex/mihomo/constant/provider" ) var ( diff --git a/adapter/provider/provider.go b/adapter/provider/provider.go index d547dcb7..ffaec91b 100644 --- a/adapter/provider/provider.go +++ b/adapter/provider/provider.go @@ -10,15 +10,15 @@ import ( "strings" "time" - "github.com/Dreamacro/clash/adapter" - "github.com/Dreamacro/clash/common/convert" - "github.com/Dreamacro/clash/common/utils" - clashHttp "github.com/Dreamacro/clash/component/http" - "github.com/Dreamacro/clash/component/resource" - C "github.com/Dreamacro/clash/constant" - types "github.com/Dreamacro/clash/constant/provider" - "github.com/Dreamacro/clash/log" - "github.com/Dreamacro/clash/tunnel/statistic" + "github.com/metacubex/mihomo/adapter" + "github.com/metacubex/mihomo/common/convert" + "github.com/metacubex/mihomo/common/utils" + mihomoHttp "github.com/metacubex/mihomo/component/http" + "github.com/metacubex/mihomo/component/resource" + C "github.com/metacubex/mihomo/constant" + types "github.com/metacubex/mihomo/constant/provider" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/tunnel/statistic" "github.com/dlclark/regexp2" "gopkg.in/yaml.v3" @@ -119,8 +119,8 @@ func (pp *proxySetProvider) getSubscriptionInfo() { go func() { ctx, cancel := context.WithTimeout(context.Background(), time.Second*90) defer cancel() - resp, err := clashHttp.HttpRequest(ctx, pp.Vehicle().(*resource.HTTPVehicle).Url(), - http.MethodGet, http.Header{"User-Agent": {"clash"}}, nil) + resp, err := mihomoHttp.HttpRequest(ctx, pp.Vehicle().(*resource.HTTPVehicle).Url(), + http.MethodGet, http.Header{"User-Agent": {"mihomo"}}, nil) if err != nil { return } @@ -128,7 +128,7 @@ func (pp *proxySetProvider) getSubscriptionInfo() { userInfoStr := strings.TrimSpace(resp.Header.Get("subscription-userinfo")) if userInfoStr == "" { - resp2, err := clashHttp.HttpRequest(ctx, pp.Vehicle().(*resource.HTTPVehicle).Url(), + resp2, err := mihomoHttp.HttpRequest(ctx, pp.Vehicle().(*resource.HTTPVehicle).Url(), http.MethodGet, http.Header{"User-Agent": {"Quantumultx"}}, nil) if err != nil { return diff --git a/common/cache/lrucache.go b/common/cache/lrucache.go index 2f9d3e79..d71cc3b9 100644 --- a/common/cache/lrucache.go +++ b/common/cache/lrucache.go @@ -6,7 +6,7 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/common/generics/list" + "github.com/metacubex/mihomo/common/generics/list" "github.com/samber/lo" ) diff --git a/common/callback/callback.go b/common/callback/callback.go index fe76dc67..9ae0f94a 100644 --- a/common/callback/callback.go +++ b/common/callback/callback.go @@ -1,9 +1,9 @@ package callback import ( - "github.com/Dreamacro/clash/common/buf" - N "github.com/Dreamacro/clash/common/net" - C "github.com/Dreamacro/clash/constant" + "github.com/metacubex/mihomo/common/buf" + N "github.com/metacubex/mihomo/common/net" + C "github.com/metacubex/mihomo/constant" ) type firstWriteCallBackConn struct { diff --git a/common/convert/converter.go b/common/convert/converter.go index 5a618f42..55035bbe 100644 --- a/common/convert/converter.go +++ b/common/convert/converter.go @@ -9,10 +9,10 @@ import ( "strconv" "strings" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/log" ) -// ConvertsV2Ray convert V2Ray subscribe proxies data to clash proxies config +// ConvertsV2Ray convert V2Ray subscribe proxies data to mihomo proxies config func ConvertsV2Ray(buf []byte) ([]map[string]any, error) { data := DecodeBase64(buf) diff --git a/common/convert/util.go b/common/convert/util.go index 0ec35acd..a715b556 100644 --- a/common/convert/util.go +++ b/common/convert/util.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Dreamacro/clash/common/utils" + "github.com/metacubex/mihomo/common/utils" "github.com/metacubex/sing-shadowsocks/shadowimpl" "github.com/zhangyunhao116/fastrand" diff --git a/common/net/bufconn.go b/common/net/bufconn.go index b840fefc..37c8ba25 100644 --- a/common/net/bufconn.go +++ b/common/net/bufconn.go @@ -4,7 +4,7 @@ import ( "bufio" "net" - "github.com/Dreamacro/clash/common/buf" + "github.com/metacubex/mihomo/common/buf" ) var _ ExtendedConn = (*BufferedConn)(nil) diff --git a/common/net/cached.go b/common/net/cached.go index 3b7da44c..fb605b74 100644 --- a/common/net/cached.go +++ b/common/net/cached.go @@ -3,7 +3,7 @@ package net import ( "net" - "github.com/Dreamacro/clash/common/buf" + "github.com/metacubex/mihomo/common/buf" ) var _ ExtendedConn = (*CachedConn)(nil) diff --git a/common/net/deadline/packet.go b/common/net/deadline/packet.go index bcf2db9d..67043198 100644 --- a/common/net/deadline/packet.go +++ b/common/net/deadline/packet.go @@ -6,8 +6,8 @@ import ( "runtime" "time" - "github.com/Dreamacro/clash/common/atomic" - "github.com/Dreamacro/clash/common/net/packet" + "github.com/metacubex/mihomo/common/atomic" + "github.com/metacubex/mihomo/common/net/packet" ) type readResult struct { diff --git a/common/net/deadline/packet_enhance.go b/common/net/deadline/packet_enhance.go index 5b7d767f..3e314fb8 100644 --- a/common/net/deadline/packet_enhance.go +++ b/common/net/deadline/packet_enhance.go @@ -5,7 +5,7 @@ import ( "os" "runtime" - "github.com/Dreamacro/clash/common/net/packet" + "github.com/metacubex/mihomo/common/net/packet" ) type EnhancePacketConn struct { diff --git a/common/net/deadline/packet_sing.go b/common/net/deadline/packet_sing.go index f41f3f5b..65db1b8f 100644 --- a/common/net/deadline/packet_sing.go +++ b/common/net/deadline/packet_sing.go @@ -4,7 +4,7 @@ import ( "os" "runtime" - "github.com/Dreamacro/clash/common/net/packet" + "github.com/metacubex/mihomo/common/net/packet" "github.com/sagernet/sing/common/buf" "github.com/sagernet/sing/common/bufio" M "github.com/sagernet/sing/common/metadata" diff --git a/common/net/packet.go b/common/net/packet.go index fc562c42..fd03b4f8 100644 --- a/common/net/packet.go +++ b/common/net/packet.go @@ -1,8 +1,8 @@ package net import ( - "github.com/Dreamacro/clash/common/net/deadline" - "github.com/Dreamacro/clash/common/net/packet" + "github.com/metacubex/mihomo/common/net/deadline" + "github.com/metacubex/mihomo/common/net/packet" ) type EnhancePacketConn = packet.EnhancePacketConn diff --git a/common/net/packet/packet.go b/common/net/packet/packet.go index 6c9542c1..0cdbccae 100644 --- a/common/net/packet/packet.go +++ b/common/net/packet/packet.go @@ -3,7 +3,7 @@ package packet import ( "net" - "github.com/Dreamacro/clash/common/pool" + "github.com/metacubex/mihomo/common/pool" ) type WaitReadFrom interface { diff --git a/common/net/packet/packet_posix.go b/common/net/packet/packet_posix.go index 2861482f..2073e35d 100644 --- a/common/net/packet/packet_posix.go +++ b/common/net/packet/packet_posix.go @@ -7,7 +7,7 @@ import ( "strconv" "syscall" - "github.com/Dreamacro/clash/common/pool" + "github.com/metacubex/mihomo/common/pool" ) type enhanceUDPConn struct { diff --git a/common/net/refconn.go b/common/net/refconn.go index 5caaebc8..6d0dde98 100644 --- a/common/net/refconn.go +++ b/common/net/refconn.go @@ -5,7 +5,7 @@ import ( "runtime" "time" - "github.com/Dreamacro/clash/common/buf" + "github.com/metacubex/mihomo/common/buf" ) type refConn struct { diff --git a/common/net/relay.go b/common/net/relay.go index 6191e76b..f2a1b146 100644 --- a/common/net/relay.go +++ b/common/net/relay.go @@ -12,7 +12,7 @@ package net // // go func() { // // Wrapping to avoid using *net.TCPConn.(ReadFrom) -// // See also https://github.com/Dreamacro/clash/pull/1209 +// // See also https://github.com/metacubex/mihomo/pull/1209 // _, err := io.Copy(WriteOnlyWriter{Writer: leftConn}, ReadOnlyReader{Reader: rightConn}) // leftConn.SetReadDeadline(time.Now()) // ch <- err diff --git a/common/observable/observable_test.go b/common/observable/observable_test.go index 5a02273d..d263cb94 100644 --- a/common/observable/observable_test.go +++ b/common/observable/observable_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/Dreamacro/clash/common/atomic" + "github.com/metacubex/mihomo/common/atomic" "github.com/stretchr/testify/assert" ) diff --git a/common/singledo/singledo_test.go b/common/singledo/singledo_test.go index 9e114fb7..2f92f0ae 100644 --- a/common/singledo/singledo_test.go +++ b/common/singledo/singledo_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/Dreamacro/clash/common/atomic" + "github.com/metacubex/mihomo/common/atomic" "github.com/stretchr/testify/assert" ) diff --git a/component/dhcp/conn.go b/component/dhcp/conn.go index 5b71d3cd..ff26275b 100644 --- a/component/dhcp/conn.go +++ b/component/dhcp/conn.go @@ -5,7 +5,7 @@ import ( "net" "runtime" - "github.com/Dreamacro/clash/component/dialer" + "github.com/metacubex/mihomo/component/dialer" ) func ListenDHCPClient(ctx context.Context, ifaceName string) (net.PacketConn, error) { diff --git a/component/dhcp/dhcp.go b/component/dhcp/dhcp.go index be2c578a..04ad2eda 100644 --- a/component/dhcp/dhcp.go +++ b/component/dhcp/dhcp.go @@ -6,8 +6,8 @@ import ( "net" "net/netip" - "github.com/Dreamacro/clash/common/nnip" - "github.com/Dreamacro/clash/component/iface" + "github.com/metacubex/mihomo/common/nnip" + "github.com/metacubex/mihomo/component/iface" "github.com/insomniacslk/dhcp/dhcpv4" ) diff --git a/component/dialer/bind.go b/component/dialer/bind.go index c90212ef..72df8c72 100644 --- a/component/dialer/bind.go +++ b/component/dialer/bind.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "github.com/Dreamacro/clash/component/iface" + "github.com/metacubex/mihomo/component/iface" ) func LookupLocalAddrFromIfaceName(ifaceName string, network string, destination netip.Addr, port int) (net.Addr, error) { diff --git a/component/dialer/bind_darwin.go b/component/dialer/bind_darwin.go index 8705a708..f83b86f8 100644 --- a/component/dialer/bind_darwin.go +++ b/component/dialer/bind_darwin.go @@ -6,7 +6,7 @@ import ( "net/netip" "syscall" - "github.com/Dreamacro/clash/component/iface" + "github.com/metacubex/mihomo/component/iface" "golang.org/x/sys/unix" ) diff --git a/component/dialer/bind_windows.go b/component/dialer/bind_windows.go index 0d38d1c5..120f1657 100644 --- a/component/dialer/bind_windows.go +++ b/component/dialer/bind_windows.go @@ -9,7 +9,7 @@ import ( "syscall" "unsafe" - "github.com/Dreamacro/clash/component/iface" + "github.com/metacubex/mihomo/component/iface" ) const ( diff --git a/component/dialer/dialer.go b/component/dialer/dialer.go index 3cb8bba9..0e0e3cef 100644 --- a/component/dialer/dialer.go +++ b/component/dialer/dialer.go @@ -11,7 +11,7 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/component/resolver" + "github.com/metacubex/mihomo/component/resolver" ) type dialFunc func(ctx context.Context, network string, ips []netip.Addr, port string, opt *option) (net.Conn, error) diff --git a/component/dialer/mark_nonlinux.go b/component/dialer/mark_nonlinux.go index ea448276..64e58784 100644 --- a/component/dialer/mark_nonlinux.go +++ b/component/dialer/mark_nonlinux.go @@ -7,7 +7,7 @@ import ( "net/netip" "sync" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/log" ) var printMarkWarnOnce sync.Once diff --git a/component/dialer/options.go b/component/dialer/options.go index 781d7164..c0c21891 100644 --- a/component/dialer/options.go +++ b/component/dialer/options.go @@ -4,8 +4,8 @@ import ( "context" "net" - "github.com/Dreamacro/clash/common/atomic" - "github.com/Dreamacro/clash/component/resolver" + "github.com/metacubex/mihomo/common/atomic" + "github.com/metacubex/mihomo/component/resolver" ) var ( diff --git a/component/ebpf/bpf/redir.c b/component/ebpf/bpf/redir.c index a24afec8..6ef5ee0c 100644 --- a/component/ebpf/bpf/redir.c +++ b/component/ebpf/bpf/redir.c @@ -173,7 +173,7 @@ static __always_inline bool is_lan_ip(__be32 addr) { return false; } -SEC("tc_clash_auto_redir_ingress") +SEC("tc_mihomo_auto_redir_ingress") int tc_redir_ingress_func(struct __sk_buff *skb) { void *data = (void *)(long)skb->data; void *data_end = (void *)(long)skb->data_end; @@ -264,7 +264,7 @@ int tc_redir_ingress_func(struct __sk_buff *skb) { return TC_ACT_OK; } -SEC("tc_clash_auto_redir_egress") +SEC("tc_mihomo_auto_redir_egress") int tc_redir_egress_func(struct __sk_buff *skb) { void *data = (void *)(long)skb->data; void *data_end = (void *)(long)skb->data_end; @@ -276,10 +276,10 @@ int tc_redir_egress_func(struct __sk_buff *skb) { if (eth->h_proto != bpf_htons(ETH_P_IP)) return TC_ACT_OK; - __u32 key = 0, *redir_ip, *redir_port; // *clash_mark + __u32 key = 0, *redir_ip, *redir_port; // *mihomo_mark -// clash_mark = bpf_map_lookup_elem(&redir_params_map, &key); -// if (clash_mark && *clash_mark != 0 && *clash_mark == skb->mark) +// mihomo_mark = bpf_map_lookup_elem(&redir_params_map, &key); +// if (mihomo_mark && *mihomo_mark != 0 && *mihomo_mark == skb->mark) // return TC_ACT_OK; struct iphdr *iph = (struct iphdr *)(eth + 1); diff --git a/component/ebpf/bpf/tc.c b/component/ebpf/bpf/tc.c index 4eebf41c..3513bf04 100644 --- a/component/ebpf/bpf/tc.c +++ b/component/ebpf/bpf/tc.c @@ -38,7 +38,7 @@ static __always_inline bool is_lan_ip(__be32 addr) { return false; } -SEC("tc_clash_redirect_to_tun") +SEC("tc_mihomo_redirect_to_tun") int tc_tun_func(struct __sk_buff *skb) { void *data = (void *)(long)skb->data; void *data_end = (void *)(long)skb->data_end; @@ -50,13 +50,13 @@ int tc_tun_func(struct __sk_buff *skb) { if (eth->h_proto == bpf_htons(ETH_P_ARP)) return TC_ACT_OK; - __u32 key = 0, *clash_mark, *tun_ifindex; + __u32 key = 0, *mihomo_mark, *tun_ifindex; - clash_mark = bpf_map_lookup_elem(&tc_params_map, &key); - if (!clash_mark) + mihomo_mark = bpf_map_lookup_elem(&tc_params_map, &key); + if (!mihomo_mark) return TC_ACT_OK; - if (skb->mark == *clash_mark) + if (skb->mark == *mihomo_mark) return TC_ACT_OK; if (eth->h_proto == bpf_htons(ETH_P_IP)) { diff --git a/component/ebpf/ebpf.go b/component/ebpf/ebpf.go index 6257675c..b0f5a65f 100644 --- a/component/ebpf/ebpf.go +++ b/component/ebpf/ebpf.go @@ -3,8 +3,8 @@ package ebpf import ( "net/netip" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/socks5" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/socks5" ) type TcEBpfProgram struct { diff --git a/component/ebpf/ebpf_linux.go b/component/ebpf/ebpf_linux.go index 2ffd4bd5..304f32fe 100644 --- a/component/ebpf/ebpf_linux.go +++ b/component/ebpf/ebpf_linux.go @@ -6,11 +6,11 @@ import ( "fmt" "net/netip" - "github.com/Dreamacro/clash/common/cmd" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/ebpf/redir" - "github.com/Dreamacro/clash/component/ebpf/tc" - C "github.com/Dreamacro/clash/constant" + "github.com/metacubex/mihomo/common/cmd" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/ebpf/redir" + "github.com/metacubex/mihomo/component/ebpf/tc" + C "github.com/metacubex/mihomo/constant" "github.com/sagernet/netlink" ) @@ -47,7 +47,7 @@ func NewTcEBpfProgram(ifaceNames []string, tunName string) (*TcEBpfProgram, erro tunIndex := uint32(tunIface.Attrs().Index) - dialer.DefaultRoutingMark.Store(C.ClashTrafficMark) + dialer.DefaultRoutingMark.Store(C.MihomoTrafficMark) ifMark := uint32(dialer.DefaultRoutingMark.Load()) diff --git a/component/ebpf/redir/auto_redirect.go b/component/ebpf/redir/auto_redirect.go index 4fd8b785..57c99616 100644 --- a/component/ebpf/redir/auto_redirect.go +++ b/component/ebpf/redir/auto_redirect.go @@ -16,9 +16,9 @@ import ( "github.com/sagernet/netlink" "golang.org/x/sys/unix" - "github.com/Dreamacro/clash/component/ebpf/byteorder" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/component/ebpf/byteorder" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/socks5" ) //go:generate go run github.com/cilium/ebpf/cmd/bpf2go -cc $BPF_CLANG -cflags $BPF_CFLAGS bpf ../bpf/redir.c @@ -131,7 +131,7 @@ func (e *EBpfRedirect) Start() error { filter := &netlink.BpfFilter{ FilterAttrs: filterAttrs, Fd: objs.bpfPrograms.TcRedirIngressFunc.FD(), - Name: "clash-redir-ingress-" + e.ifName, + Name: "mihomo-redir-ingress-" + e.ifName, DirectAction: true, } @@ -153,7 +153,7 @@ func (e *EBpfRedirect) Start() error { filterEgress := &netlink.BpfFilter{ FilterAttrs: filterAttrsEgress, Fd: objs.bpfPrograms.TcRedirEgressFunc.FD(), - Name: "clash-redir-egress-" + e.ifName, + Name: "mihomo-redir-egress-" + e.ifName, DirectAction: true, } diff --git a/component/ebpf/tc/redirect_to_tun.go b/component/ebpf/tc/redirect_to_tun.go index 1edc1781..d7be64af 100644 --- a/component/ebpf/tc/redirect_to_tun.go +++ b/component/ebpf/tc/redirect_to_tun.go @@ -14,8 +14,8 @@ import ( "github.com/sagernet/netlink" "golang.org/x/sys/unix" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/socks5" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/socks5" ) //go:generate go run github.com/cilium/ebpf/cmd/bpf2go -cc $BPF_CLANG -cflags $BPF_CFLAGS bpf ../bpf/tc.c @@ -115,7 +115,7 @@ func (e *EBpfTC) Start() error { filter := &netlink.BpfFilter{ FilterAttrs: filterAttrs, Fd: objs.bpfPrograms.TcTunFunc.FD(), - Name: "clash-tc-" + e.ifName, + Name: "mihomo-tc-" + e.ifName, DirectAction: true, } diff --git a/component/fakeip/cachefile.go b/component/fakeip/cachefile.go index c31d751f..6f0cc48b 100644 --- a/component/fakeip/cachefile.go +++ b/component/fakeip/cachefile.go @@ -3,7 +3,7 @@ package fakeip import ( "net/netip" - "github.com/Dreamacro/clash/component/profile/cachefile" + "github.com/metacubex/mihomo/component/profile/cachefile" ) type cachefileStore struct { diff --git a/component/fakeip/memory.go b/component/fakeip/memory.go index 249c5e2a..f36bbb55 100644 --- a/component/fakeip/memory.go +++ b/component/fakeip/memory.go @@ -3,7 +3,7 @@ package fakeip import ( "net/netip" - "github.com/Dreamacro/clash/common/cache" + "github.com/metacubex/mihomo/common/cache" ) type memoryStore struct { diff --git a/component/fakeip/pool.go b/component/fakeip/pool.go index 9b51929e..2b06fc0b 100644 --- a/component/fakeip/pool.go +++ b/component/fakeip/pool.go @@ -6,9 +6,9 @@ import ( "strings" "sync" - "github.com/Dreamacro/clash/common/nnip" - "github.com/Dreamacro/clash/component/profile/cachefile" - "github.com/Dreamacro/clash/component/trie" + "github.com/metacubex/mihomo/common/nnip" + "github.com/metacubex/mihomo/component/profile/cachefile" + "github.com/metacubex/mihomo/component/trie" ) const ( diff --git a/component/fakeip/pool_test.go b/component/fakeip/pool_test.go index 183a7185..a7569ab0 100644 --- a/component/fakeip/pool_test.go +++ b/component/fakeip/pool_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - "github.com/Dreamacro/clash/component/profile/cachefile" - "github.com/Dreamacro/clash/component/trie" + "github.com/metacubex/mihomo/component/profile/cachefile" + "github.com/metacubex/mihomo/component/trie" "github.com/stretchr/testify/assert" "go.etcd.io/bbolt" @@ -32,7 +32,7 @@ func createCachefileStore(options Options) (*Pool, string, error) { if err != nil { return nil, "", err } - f, err := os.CreateTemp("", "clash") + f, err := os.CreateTemp("", "mihomo") if err != nil { return nil, "", err } diff --git a/component/geodata/attr.go b/component/geodata/attr.go index e35a25ca..a9742aca 100644 --- a/component/geodata/attr.go +++ b/component/geodata/attr.go @@ -3,7 +3,7 @@ package geodata import ( "strings" - "github.com/Dreamacro/clash/component/geodata/router" + "github.com/metacubex/mihomo/component/geodata/router" ) type AttributeList struct { diff --git a/component/geodata/geodata.go b/component/geodata/geodata.go index 9d0b0df0..a6ef146a 100644 --- a/component/geodata/geodata.go +++ b/component/geodata/geodata.go @@ -3,8 +3,8 @@ package geodata import ( "fmt" - "github.com/Dreamacro/clash/component/geodata/router" - C "github.com/Dreamacro/clash/constant" + "github.com/metacubex/mihomo/component/geodata/router" + C "github.com/metacubex/mihomo/constant" ) type loader struct { diff --git a/component/geodata/geodataproto.go b/component/geodata/geodataproto.go index 34bdad70..0f1ce4d2 100644 --- a/component/geodata/geodataproto.go +++ b/component/geodata/geodataproto.go @@ -1,7 +1,7 @@ package geodata import ( - "github.com/Dreamacro/clash/component/geodata/router" + "github.com/metacubex/mihomo/component/geodata/router" ) type LoaderImplementation interface { diff --git a/component/geodata/init.go b/component/geodata/init.go index acae1a34..0b193c94 100644 --- a/component/geodata/init.go +++ b/component/geodata/init.go @@ -8,10 +8,10 @@ import ( "os" "time" - clashHttp "github.com/Dreamacro/clash/component/http" - "github.com/Dreamacro/clash/component/mmdb" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + mihomoHttp "github.com/metacubex/mihomo/component/http" + "github.com/metacubex/mihomo/component/mmdb" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" ) var initGeoSite bool @@ -44,7 +44,7 @@ func InitGeoSite() error { func downloadGeoSite(path string) (err error) { ctx, cancel := context.WithTimeout(context.Background(), time.Second*90) defer cancel() - resp, err := clashHttp.HttpRequest(ctx, C.GeoSiteUrl, http.MethodGet, http.Header{"User-Agent": {"clash"}}, nil) + resp, err := mihomoHttp.HttpRequest(ctx, C.GeoSiteUrl, http.MethodGet, http.Header{"User-Agent": {"mihomo"}}, nil) if err != nil { return } @@ -63,7 +63,7 @@ func downloadGeoSite(path string) (err error) { func downloadGeoIP(path string) (err error) { ctx, cancel := context.WithTimeout(context.Background(), time.Second*90) defer cancel() - resp, err := clashHttp.HttpRequest(ctx, C.GeoIpUrl, http.MethodGet, http.Header{"User-Agent": {"clash"}}, nil) + resp, err := mihomoHttp.HttpRequest(ctx, C.GeoIpUrl, http.MethodGet, http.Header{"User-Agent": {"mihomo"}}, nil) if err != nil { return } diff --git a/component/geodata/memconservative/cache.go b/component/geodata/memconservative/cache.go index ca78d19d..ef76a42c 100644 --- a/component/geodata/memconservative/cache.go +++ b/component/geodata/memconservative/cache.go @@ -5,9 +5,9 @@ import ( "os" "strings" - "github.com/Dreamacro/clash/component/geodata/router" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/component/geodata/router" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" "google.golang.org/protobuf/proto" ) diff --git a/component/geodata/memconservative/memc.go b/component/geodata/memconservative/memc.go index 88d3b4e5..30d89f10 100644 --- a/component/geodata/memconservative/memc.go +++ b/component/geodata/memconservative/memc.go @@ -5,8 +5,8 @@ import ( "fmt" "runtime" - "github.com/Dreamacro/clash/component/geodata" - "github.com/Dreamacro/clash/component/geodata/router" + "github.com/metacubex/mihomo/component/geodata" + "github.com/metacubex/mihomo/component/geodata/router" ) type memConservativeLoader struct { diff --git a/component/geodata/router/condition.go b/component/geodata/router/condition.go index 4e0ad46c..156614ae 100644 --- a/component/geodata/router/condition.go +++ b/component/geodata/router/condition.go @@ -7,7 +7,7 @@ import ( "sort" "strings" - "github.com/Dreamacro/clash/component/geodata/strmatcher" + "github.com/metacubex/mihomo/component/geodata/strmatcher" ) var matcherTypeMap = map[Domain_Type]strmatcher.Type{ diff --git a/component/geodata/router/config.pb.go b/component/geodata/router/config.pb.go index 7c3af22a..59d90c7a 100644 --- a/component/geodata/router/config.pb.go +++ b/component/geodata/router/config.pb.go @@ -84,7 +84,7 @@ type Domain struct { unknownFields protoimpl.UnknownFields // Domain matching type. - Type Domain_Type `protobuf:"varint,1,opt,name=type,proto3,enum=clash.component.geodata.router.Domain_Type" json:"type,omitempty"` + Type Domain_Type `protobuf:"varint,1,opt,name=type,proto3,enum=mihomo.component.geodata.router.Domain_Type" json:"type,omitempty"` // Domain value. Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // Attributes of this domain. May be used for filtering. @@ -585,22 +585,22 @@ func file_component_geodata_router_config_proto_rawDescGZIP() []byte { var file_component_geodata_router_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_component_geodata_router_config_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_component_geodata_router_config_proto_goTypes = []interface{}{ - (Domain_Type)(0), // 0: clash.component.geodata.router.Domain.Type - (*Domain)(nil), // 1: clash.component.geodata.router.Domain - (*CIDR)(nil), // 2: clash.component.geodata.router.CIDR - (*GeoIP)(nil), // 3: clash.component.geodata.router.GeoIP - (*GeoIPList)(nil), // 4: clash.component.geodata.router.GeoIPList - (*GeoSite)(nil), // 5: clash.component.geodata.router.GeoSite - (*GeoSiteList)(nil), // 6: clash.component.geodata.router.GeoSiteList - (*Domain_Attribute)(nil), // 7: clash.component.geodata.router.Domain.Attribute + (Domain_Type)(0), // 0: mihomo.component.geodata.router.Domain.Type + (*Domain)(nil), // 1: mihomo.component.geodata.router.Domain + (*CIDR)(nil), // 2: mihomo.component.geodata.router.CIDR + (*GeoIP)(nil), // 3: mihomo.component.geodata.router.GeoIP + (*GeoIPList)(nil), // 4: mihomo.component.geodata.router.GeoIPList + (*GeoSite)(nil), // 5: mihomo.component.geodata.router.GeoSite + (*GeoSiteList)(nil), // 6: mihomo.component.geodata.router.GeoSiteList + (*Domain_Attribute)(nil), // 7: mihomo.component.geodata.router.Domain.Attribute } var file_component_geodata_router_config_proto_depIdxs = []int32{ - 0, // 0: clash.component.geodata.router.Domain.type:type_name -> clash.component.geodata.router.Domain.Type - 7, // 1: clash.component.geodata.router.Domain.attribute:type_name -> clash.component.geodata.router.Domain.Attribute - 2, // 2: clash.component.geodata.router.GeoIP.cidr:type_name -> clash.component.geodata.router.CIDR - 3, // 3: clash.component.geodata.router.GeoIPList.entry:type_name -> clash.component.geodata.router.GeoIP - 1, // 4: clash.component.geodata.router.GeoSite.domain:type_name -> clash.component.geodata.router.Domain - 5, // 5: clash.component.geodata.router.GeoSiteList.entry:type_name -> clash.component.geodata.router.GeoSite + 0, // 0: mihomo.component.geodata.router.Domain.type:type_name -> mihomo.component.geodata.router.Domain.Type + 7, // 1: mihomo.component.geodata.router.Domain.attribute:type_name -> mihomo.component.geodata.router.Domain.Attribute + 2, // 2: mihomo.component.geodata.router.GeoIP.cidr:type_name -> mihomo.component.geodata.router.CIDR + 3, // 3: mihomo.component.geodata.router.GeoIPList.entry:type_name -> mihomo.component.geodata.router.GeoIP + 1, // 4: mihomo.component.geodata.router.GeoSite.domain:type_name -> mihomo.component.geodata.router.Domain + 5, // 5: mihomo.component.geodata.router.GeoSiteList.entry:type_name -> mihomo.component.geodata.router.GeoSite 6, // [6:6] is the sub-list for method output_type 6, // [6:6] is the sub-list for method input_type 6, // [6:6] is the sub-list for extension type_name diff --git a/component/geodata/router/config.proto b/component/geodata/router/config.proto index 245faadf..98795740 100644 --- a/component/geodata/router/config.proto +++ b/component/geodata/router/config.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package clash.component.geodata.router; -option csharp_namespace = "Clash.Component.Geodata.Router"; -option go_package = "github.com/Dreamacro/clash/component/geodata/router"; -option java_package = "com.clash.component.geodata.router"; +package mihomo.component.geodata.router; +option csharp_namespace = "Mihomo.Component.Geodata.Router"; +option go_package = "github.com/metacubex/mihomo/component/geodata/router"; +option java_package = "com.mihomo.component.geodata.router"; option java_multiple_files = true; // Domain for routing decision. diff --git a/component/geodata/standard/standard.go b/component/geodata/standard/standard.go index 355cbf34..bfaae5ec 100644 --- a/component/geodata/standard/standard.go +++ b/component/geodata/standard/standard.go @@ -6,9 +6,9 @@ import ( "os" "strings" - "github.com/Dreamacro/clash/component/geodata" - "github.com/Dreamacro/clash/component/geodata/router" - C "github.com/Dreamacro/clash/constant" + "github.com/metacubex/mihomo/component/geodata" + "github.com/metacubex/mihomo/component/geodata/router" + C "github.com/metacubex/mihomo/constant" "google.golang.org/protobuf/proto" ) diff --git a/component/geodata/strmatcher/ac_automaton_matcher.go b/component/geodata/strmatcher/ac_automaton_matcher.go index d134c68a..ca7dc48b 100644 --- a/component/geodata/strmatcher/ac_automaton_matcher.go +++ b/component/geodata/strmatcher/ac_automaton_matcher.go @@ -1,7 +1,7 @@ package strmatcher import ( - "github.com/Dreamacro/clash/common/generics/list" + "github.com/metacubex/mihomo/common/generics/list" ) const validCharCount = 53 diff --git a/component/geodata/utils.go b/component/geodata/utils.go index 04ccfa51..4716ccbd 100644 --- a/component/geodata/utils.go +++ b/component/geodata/utils.go @@ -6,9 +6,9 @@ import ( "golang.org/x/sync/singleflight" "strings" - "github.com/Dreamacro/clash/component/geodata/router" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/component/geodata/router" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" ) var geoLoaderName = "memconservative" diff --git a/component/http/http.go b/component/http/http.go index 073f0237..455db681 100644 --- a/component/http/http.go +++ b/component/http/http.go @@ -11,9 +11,9 @@ import ( "strings" "time" - "github.com/Dreamacro/clash/component/ca" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/listener/inner" + "github.com/metacubex/mihomo/component/ca" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/listener/inner" ) func HttpRequest(ctx context.Context, url, method string, header map[string][]string, body io.Reader) (*http.Response, error) { diff --git a/component/iface/iface.go b/component/iface/iface.go index 03051cb3..bf186165 100644 --- a/component/iface/iface.go +++ b/component/iface/iface.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/Dreamacro/clash/common/singledo" + "github.com/metacubex/mihomo/common/singledo" ) type Interface struct { diff --git a/component/mmdb/mmdb.go b/component/mmdb/mmdb.go index 5db8bee9..f83b9922 100644 --- a/component/mmdb/mmdb.go +++ b/component/mmdb/mmdb.go @@ -8,9 +8,9 @@ import ( "sync" "time" - clashHttp "github.com/Dreamacro/clash/component/http" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + mihomoHttp "github.com/metacubex/mihomo/component/http" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" "github.com/oschwald/maxminddb-golang" ) @@ -79,7 +79,7 @@ func Instance() Reader { func DownloadMMDB(path string) (err error) { ctx, cancel := context.WithTimeout(context.Background(), time.Second*90) defer cancel() - resp, err := clashHttp.HttpRequest(ctx, C.MmdbUrl, http.MethodGet, http.Header{"User-Agent": {"clash"}}, nil) + resp, err := mihomoHttp.HttpRequest(ctx, C.MmdbUrl, http.MethodGet, http.Header{"User-Agent": {"mihomo"}}, nil) if err != nil { return } diff --git a/component/nat/proxy.go b/component/nat/proxy.go index 29ff3c81..66af3be2 100644 --- a/component/nat/proxy.go +++ b/component/nat/proxy.go @@ -3,8 +3,8 @@ package nat import ( "net" - "github.com/Dreamacro/clash/common/atomic" - C "github.com/Dreamacro/clash/constant" + "github.com/metacubex/mihomo/common/atomic" + C "github.com/metacubex/mihomo/constant" ) type writeBackProxy struct { diff --git a/component/nat/table.go b/component/nat/table.go index df258dc2..b2908c94 100644 --- a/component/nat/table.go +++ b/component/nat/table.go @@ -4,7 +4,7 @@ import ( "net" "sync" - C "github.com/Dreamacro/clash/constant" + C "github.com/metacubex/mihomo/constant" "github.com/puzpuzpuz/xsync/v2" ) diff --git a/component/process/process_freebsd_amd64.go b/component/process/process_freebsd_amd64.go index 709ade3b..1884afcc 100644 --- a/component/process/process_freebsd_amd64.go +++ b/component/process/process_freebsd_amd64.go @@ -10,8 +10,8 @@ import ( "syscall" "unsafe" - "github.com/Dreamacro/clash/common/nnip" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/common/nnip" + "github.com/metacubex/mihomo/log" ) // store process name for when dealing with multiple PROCESS-NAME rules diff --git a/component/process/process_windows.go b/component/process/process_windows.go index 21878bf6..d43c78c6 100644 --- a/component/process/process_windows.go +++ b/component/process/process_windows.go @@ -7,8 +7,8 @@ import ( "syscall" "unsafe" - "github.com/Dreamacro/clash/common/nnip" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/common/nnip" + "github.com/metacubex/mihomo/log" "golang.org/x/sys/windows" ) diff --git a/component/profile/cachefile/cache.go b/component/profile/cachefile/cache.go index 3d2dd1de..68812824 100644 --- a/component/profile/cachefile/cache.go +++ b/component/profile/cachefile/cache.go @@ -5,9 +5,9 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/component/profile" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/component/profile" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" "go.etcd.io/bbolt" ) diff --git a/component/profile/profile.go b/component/profile/profile.go index aa6df2f7..36db8cc3 100644 --- a/component/profile/profile.go +++ b/component/profile/profile.go @@ -1,7 +1,7 @@ package profile import ( - "github.com/Dreamacro/clash/common/atomic" + "github.com/metacubex/mihomo/common/atomic" ) // StoreSelected is a global switch for storing selected proxy to cache diff --git a/component/proxydialer/proxydialer.go b/component/proxydialer/proxydialer.go index 2d14abae..71a658b8 100644 --- a/component/proxydialer/proxydialer.go +++ b/component/proxydialer/proxydialer.go @@ -8,12 +8,12 @@ import ( "net/netip" "strings" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/resolver" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/tunnel" - "github.com/Dreamacro/clash/tunnel/statistic" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/resolver" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/tunnel" + "github.com/metacubex/mihomo/tunnel/statistic" ) type proxyDialer struct { diff --git a/component/proxydialer/sing.go b/component/proxydialer/sing.go index 9b116527..71180c01 100644 --- a/component/proxydialer/sing.go +++ b/component/proxydialer/sing.go @@ -4,7 +4,7 @@ import ( "context" "net" - C "github.com/Dreamacro/clash/constant" + C "github.com/metacubex/mihomo/constant" M "github.com/sagernet/sing/common/metadata" N "github.com/sagernet/sing/common/network" diff --git a/component/resolver/host.go b/component/resolver/host.go index d6eb5873..69c29a3c 100644 --- a/component/resolver/host.go +++ b/component/resolver/host.go @@ -6,8 +6,8 @@ import ( "strings" _ "unsafe" - "github.com/Dreamacro/clash/common/utils" - "github.com/Dreamacro/clash/component/trie" + "github.com/metacubex/mihomo/common/utils" + "github.com/metacubex/mihomo/component/trie" "github.com/zhangyunhao116/fastrand" ) diff --git a/component/resolver/resolver.go b/component/resolver/resolver.go index 6be6a95f..8cbc62fa 100644 --- a/component/resolver/resolver.go +++ b/component/resolver/resolver.go @@ -9,8 +9,8 @@ import ( "strings" "time" - "github.com/Dreamacro/clash/common/utils" - "github.com/Dreamacro/clash/component/trie" + "github.com/metacubex/mihomo/common/utils" + "github.com/metacubex/mihomo/component/trie" "github.com/miekg/dns" "github.com/zhangyunhao116/fastrand" diff --git a/component/resource/fetcher.go b/component/resource/fetcher.go index c92687b1..31dc5c08 100644 --- a/component/resource/fetcher.go +++ b/component/resource/fetcher.go @@ -7,8 +7,8 @@ import ( "path/filepath" "time" - types "github.com/Dreamacro/clash/constant/provider" - "github.com/Dreamacro/clash/log" + types "github.com/metacubex/mihomo/constant/provider" + "github.com/metacubex/mihomo/log" "github.com/samber/lo" ) diff --git a/component/resource/vehicle.go b/component/resource/vehicle.go index 2f4bfbc8..b2e29418 100644 --- a/component/resource/vehicle.go +++ b/component/resource/vehicle.go @@ -8,8 +8,8 @@ import ( "os" "time" - clashHttp "github.com/Dreamacro/clash/component/http" - types "github.com/Dreamacro/clash/constant/provider" + mihomoHttp "github.com/metacubex/mihomo/component/http" + types "github.com/metacubex/mihomo/constant/provider" ) type FileVehicle struct { @@ -52,7 +52,7 @@ func (h *HTTPVehicle) Path() string { func (h *HTTPVehicle) Read() ([]byte, error) { ctx, cancel := context.WithTimeout(context.Background(), time.Second*20) defer cancel() - resp, err := clashHttp.HttpRequest(ctx, h.url, http.MethodGet, nil, nil) + resp, err := mihomoHttp.HttpRequest(ctx, h.url, http.MethodGet, nil, nil) if err != nil { return nil, err } diff --git a/component/sniffer/base_sniffer.go b/component/sniffer/base_sniffer.go index 6d869aa0..55f51c50 100644 --- a/component/sniffer/base_sniffer.go +++ b/component/sniffer/base_sniffer.go @@ -3,9 +3,9 @@ package sniffer import ( "errors" - "github.com/Dreamacro/clash/common/utils" - "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/constant/sniffer" + "github.com/metacubex/mihomo/common/utils" + "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/constant/sniffer" ) type SnifferConfig struct { diff --git a/component/sniffer/dispatcher.go b/component/sniffer/dispatcher.go index 11deb1ed..29bea088 100644 --- a/component/sniffer/dispatcher.go +++ b/component/sniffer/dispatcher.go @@ -8,12 +8,12 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/common/cache" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/component/trie" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/constant/sniffer" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/common/cache" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/component/trie" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/constant/sniffer" + "github.com/metacubex/mihomo/log" ) var ( diff --git a/component/sniffer/http_sniffer.go b/component/sniffer/http_sniffer.go index ee958a1c..76bf1559 100644 --- a/component/sniffer/http_sniffer.go +++ b/component/sniffer/http_sniffer.go @@ -7,9 +7,9 @@ import ( "net" "strings" - "github.com/Dreamacro/clash/common/utils" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/constant/sniffer" + "github.com/metacubex/mihomo/common/utils" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/constant/sniffer" ) var ( diff --git a/component/sniffer/quic_sniffer.go b/component/sniffer/quic_sniffer.go index ef49e5ad..0e3994f0 100644 --- a/component/sniffer/quic_sniffer.go +++ b/component/sniffer/quic_sniffer.go @@ -8,9 +8,9 @@ import ( "errors" "io" - "github.com/Dreamacro/clash/common/buf" - "github.com/Dreamacro/clash/common/utils" - C "github.com/Dreamacro/clash/constant" + "github.com/metacubex/mihomo/common/buf" + "github.com/metacubex/mihomo/common/utils" + C "github.com/metacubex/mihomo/constant" "github.com/metacubex/quic-go/quicvarint" "golang.org/x/crypto/hkdf" diff --git a/component/sniffer/tls_sniffer.go b/component/sniffer/tls_sniffer.go index b695c76f..974df79a 100644 --- a/component/sniffer/tls_sniffer.go +++ b/component/sniffer/tls_sniffer.go @@ -5,9 +5,9 @@ import ( "errors" "strings" - "github.com/Dreamacro/clash/common/utils" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/constant/sniffer" + "github.com/metacubex/mihomo/common/utils" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/constant/sniffer" ) var ( diff --git a/component/tls/reality.go b/component/tls/reality.go index 2902aa4b..250dc4d0 100644 --- a/component/tls/reality.go +++ b/component/tls/reality.go @@ -20,9 +20,9 @@ import ( "time" "unsafe" - "github.com/Dreamacro/clash/common/utils" - "github.com/Dreamacro/clash/log" - "github.com/Dreamacro/clash/ntp" + "github.com/metacubex/mihomo/common/utils" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/ntp" utls "github.com/sagernet/utls" "github.com/zhangyunhao116/fastrand" diff --git a/component/tls/utls.go b/component/tls/utls.go index 3aa030d3..787f6fad 100644 --- a/component/tls/utls.go +++ b/component/tls/utls.go @@ -4,7 +4,7 @@ import ( "crypto/tls" "net" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/log" "github.com/mroth/weightedrand/v2" utls "github.com/sagernet/utls" diff --git a/component/trie/domain_set.go b/component/trie/domain_set.go index e1ad6559..860d1235 100644 --- a/component/trie/domain_set.go +++ b/component/trie/domain_set.go @@ -7,7 +7,7 @@ import ( "sort" "strings" - "github.com/Dreamacro/clash/common/utils" + "github.com/metacubex/mihomo/common/utils" "github.com/openacid/low/bitmap" ) diff --git a/component/trie/domain_set_test.go b/component/trie/domain_set_test.go index 9e0e0b70..77106d5f 100644 --- a/component/trie/domain_set_test.go +++ b/component/trie/domain_set_test.go @@ -3,7 +3,7 @@ package trie_test import ( "testing" - "github.com/Dreamacro/clash/component/trie" + "github.com/metacubex/mihomo/component/trie" "github.com/stretchr/testify/assert" ) diff --git a/component/trie/domain_test.go b/component/trie/domain_test.go index 976055a9..4c5d8002 100644 --- a/component/trie/domain_test.go +++ b/component/trie/domain_test.go @@ -4,7 +4,7 @@ import ( "net/netip" "testing" - "github.com/Dreamacro/clash/component/trie" + "github.com/metacubex/mihomo/component/trie" "github.com/stretchr/testify/assert" ) diff --git a/component/trie/ipcidr_trie.go b/component/trie/ipcidr_trie.go index 08edbbeb..a2ccfa16 100644 --- a/component/trie/ipcidr_trie.go +++ b/component/trie/ipcidr_trie.go @@ -3,7 +3,7 @@ package trie import ( "net" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/log" ) type IPV6 bool diff --git a/config/config.go b/config/config.go index 11951aa1..76ff9d68 100644 --- a/config/config.go +++ b/config/config.go @@ -13,31 +13,31 @@ import ( "strings" "time" - "github.com/Dreamacro/clash/adapter" - "github.com/Dreamacro/clash/adapter/outbound" - "github.com/Dreamacro/clash/adapter/outboundgroup" - "github.com/Dreamacro/clash/adapter/provider" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/utils" - "github.com/Dreamacro/clash/component/auth" - "github.com/Dreamacro/clash/component/fakeip" - "github.com/Dreamacro/clash/component/geodata" - "github.com/Dreamacro/clash/component/geodata/router" - P "github.com/Dreamacro/clash/component/process" - "github.com/Dreamacro/clash/component/resolver" - SNIFF "github.com/Dreamacro/clash/component/sniffer" - tlsC "github.com/Dreamacro/clash/component/tls" - "github.com/Dreamacro/clash/component/trie" - C "github.com/Dreamacro/clash/constant" - providerTypes "github.com/Dreamacro/clash/constant/provider" - snifferTypes "github.com/Dreamacro/clash/constant/sniffer" - "github.com/Dreamacro/clash/dns" - L "github.com/Dreamacro/clash/listener" - LC "github.com/Dreamacro/clash/listener/config" - "github.com/Dreamacro/clash/log" - R "github.com/Dreamacro/clash/rules" - RP "github.com/Dreamacro/clash/rules/provider" - T "github.com/Dreamacro/clash/tunnel" + "github.com/metacubex/mihomo/adapter" + "github.com/metacubex/mihomo/adapter/outbound" + "github.com/metacubex/mihomo/adapter/outboundgroup" + "github.com/metacubex/mihomo/adapter/provider" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/utils" + "github.com/metacubex/mihomo/component/auth" + "github.com/metacubex/mihomo/component/fakeip" + "github.com/metacubex/mihomo/component/geodata" + "github.com/metacubex/mihomo/component/geodata/router" + P "github.com/metacubex/mihomo/component/process" + "github.com/metacubex/mihomo/component/resolver" + SNIFF "github.com/metacubex/mihomo/component/sniffer" + tlsC "github.com/metacubex/mihomo/component/tls" + "github.com/metacubex/mihomo/component/trie" + C "github.com/metacubex/mihomo/constant" + providerTypes "github.com/metacubex/mihomo/constant/provider" + snifferTypes "github.com/metacubex/mihomo/constant/sniffer" + "github.com/metacubex/mihomo/dns" + L "github.com/metacubex/mihomo/listener" + LC "github.com/metacubex/mihomo/listener/config" + "github.com/metacubex/mihomo/log" + R "github.com/metacubex/mihomo/rules" + RP "github.com/metacubex/mihomo/rules/provider" + T "github.com/metacubex/mihomo/tunnel" "gopkg.in/yaml.v3" ) @@ -162,7 +162,7 @@ type Experimental struct { QUICGoDisableECN bool `yaml:"quic-go-disable-ecn"` } -// Config is clash config manager +// Config is mihomo config manager type Config struct { General *General IPTables *IPTables @@ -381,7 +381,7 @@ func UnmarshalRawConfig(buf []byte) (*RawConfig, error) { ProxyGroup: []map[string]any{}, TCPConcurrent: false, FindProcessMode: P.FindProcessStrict, - GlobalUA: "clash.meta", + GlobalUA: "mihomo", Tun: RawTun{ Enable: false, Device: "", @@ -917,9 +917,9 @@ func parseHosts(cfg *RawConfig) (*trie.DomainTrie[resolver.HostValue], error) { if len(cfg.Hosts) != 0 { for domain, anyValue := range cfg.Hosts { - if str, ok := anyValue.(string); ok && str == "clash" { + if str, ok := anyValue.(string); ok && str == "mihomo" { if addrs, err := net.InterfaceAddrs(); err != nil { - log.Errorln("insert clash to host error: %s", err) + log.Errorln("insert mihomo to host error: %s", err) } else { ips := make([]netip.Addr, 0) for _, addr := range addrs { diff --git a/config/initial.go b/config/initial.go index 6d6429ab..61d12895 100644 --- a/config/initial.go +++ b/config/initial.go @@ -4,8 +4,8 @@ import ( "fmt" "os" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" ) // Init prepare necessary files diff --git a/config/update_geo.go b/config/update_geo.go index 07f211e4..718c2d07 100644 --- a/config/update_geo.go +++ b/config/update_geo.go @@ -4,9 +4,9 @@ import ( "fmt" "runtime" - "github.com/Dreamacro/clash/component/geodata" - _ "github.com/Dreamacro/clash/component/geodata/standard" - C "github.com/Dreamacro/clash/constant" + "github.com/metacubex/mihomo/component/geodata" + _ "github.com/metacubex/mihomo/component/geodata/standard" + C "github.com/metacubex/mihomo/constant" "github.com/oschwald/maxminddb-golang" ) diff --git a/config/update_ui.go b/config/update_ui.go index 27e0f382..e5596597 100644 --- a/config/update_ui.go +++ b/config/update_ui.go @@ -11,7 +11,7 @@ import ( "strings" "sync" - C "github.com/Dreamacro/clash/constant" + C "github.com/metacubex/mihomo/constant" ) var ( diff --git a/config/utils.go b/config/utils.go index 1fa54634..5a4fecbf 100644 --- a/config/utils.go +++ b/config/utils.go @@ -11,15 +11,15 @@ import ( "strings" "time" - "github.com/Dreamacro/clash/adapter/outboundgroup" - "github.com/Dreamacro/clash/common/structure" - clashHttp "github.com/Dreamacro/clash/component/http" + "github.com/metacubex/mihomo/adapter/outboundgroup" + "github.com/metacubex/mihomo/common/structure" + mihomoHttp "github.com/metacubex/mihomo/component/http" ) func downloadForBytes(url string) ([]byte, error) { ctx, cancel := context.WithTimeout(context.Background(), time.Second*90) defer cancel() - resp, err := clashHttp.HttpRequest(ctx, url, http.MethodGet, http.Header{"User-Agent": {"clash"}}, nil) + resp, err := mihomoHttp.HttpRequest(ctx, url, http.MethodGet, http.Header{"User-Agent": {"mihomo"}}, nil) if err != nil { return nil, err } diff --git a/constant/adapters.go b/constant/adapters.go index ad50a8ab..5cf6e07c 100644 --- a/constant/adapters.go +++ b/constant/adapters.go @@ -9,9 +9,9 @@ import ( "sync" "time" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/utils" - "github.com/Dreamacro/clash/component/dialer" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/utils" + "github.com/metacubex/mihomo/component/dialer" ) // Adapter Type diff --git a/constant/context.go b/constant/context.go index 1c70124b..11ad7011 100644 --- a/constant/context.go +++ b/constant/context.go @@ -3,7 +3,7 @@ package constant import ( "net" - N "github.com/Dreamacro/clash/common/net" + N "github.com/metacubex/mihomo/common/net" "github.com/gofrs/uuid/v5" ) diff --git a/constant/ebpf.go b/constant/ebpf.go index b722dce1..e3bb62fe 100644 --- a/constant/ebpf.go +++ b/constant/ebpf.go @@ -3,14 +3,14 @@ package constant import ( "net/netip" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/transport/socks5" ) const ( - BpfFSPath = "/sys/fs/bpf/clash" + BpfFSPath = "/sys/fs/bpf/mihomo" - TcpAutoRedirPort = 't'<<8 | 'r'<<0 - ClashTrafficMark = 'c'<<24 | 'l'<<16 | 't'<<8 | 'm'<<0 + TcpAutoRedirPort = 't'<<8 | 'r'<<0 + MihomoTrafficMark = 'c'<<24 | 'l'<<16 | 't'<<8 | 'm'<<0 ) type EBpf interface { diff --git a/constant/metadata.go b/constant/metadata.go index 5f472205..4b547a81 100644 --- a/constant/metadata.go +++ b/constant/metadata.go @@ -7,7 +7,7 @@ import ( "net/netip" "strconv" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/transport/socks5" ) // Socks addr type @@ -161,7 +161,7 @@ func (m *Metadata) SourceAddress() string { func (m *Metadata) SourceDetail() string { if m.Type == INNER { - return fmt.Sprintf("%s", ClashName) + return fmt.Sprintf("%s", MihomoName) } switch { diff --git a/constant/path.go b/constant/path.go index 0d82f549..a920fbbc 100644 --- a/constant/path.go +++ b/constant/path.go @@ -10,7 +10,7 @@ import ( "strings" ) -const Name = "clash" +const Name = "mihomo" var ( GeositeName = "GeoSite.dat" @@ -19,8 +19,8 @@ var ( // Path is used to get the configuration path // -// on Unix systems, `$HOME/.config/clash`. -// on Windows, `%USERPROFILE%/.config/clash`. +// on Unix systems, `$HOME/.config/mihomo`. +// on Windows, `%USERPROFILE%/.config/mihomo`. var Path = func() *path { homeDir, err := os.UserHomeDir() if err != nil { @@ -165,7 +165,7 @@ func (p *path) GetAssetLocation(file string) string { func (p *path) GetExecutableFullPath() string { exePath, err := os.Executable() if err != nil { - return "clash" + return "mihomo" } res, _ := filepath.EvalSymlinks(exePath) return res diff --git a/constant/provider/interface.go b/constant/provider/interface.go index 34590a48..809db9c5 100644 --- a/constant/provider/interface.go +++ b/constant/provider/interface.go @@ -1,8 +1,8 @@ package provider import ( - "github.com/Dreamacro/clash/common/utils" - "github.com/Dreamacro/clash/constant" + "github.com/metacubex/mihomo/common/utils" + "github.com/metacubex/mihomo/constant" ) // Vehicle Type diff --git a/constant/rule_extra.go b/constant/rule_extra.go index 3c5de5d5..62dc1cc3 100644 --- a/constant/rule_extra.go +++ b/constant/rule_extra.go @@ -1,7 +1,7 @@ package constant import ( - "github.com/Dreamacro/clash/component/geodata/router" + "github.com/metacubex/mihomo/component/geodata/router" ) type RuleGeoSite interface { diff --git a/constant/sniffer/sniffer.go b/constant/sniffer/sniffer.go index 47dbd069..36da69a3 100644 --- a/constant/sniffer/sniffer.go +++ b/constant/sniffer/sniffer.go @@ -1,6 +1,6 @@ package sniffer -import "github.com/Dreamacro/clash/constant" +import "github.com/metacubex/mihomo/constant" type Sniffer interface { SupportNetwork() constant.NetWork diff --git a/constant/version.go b/constant/version.go index cbb7ab61..c71024c2 100644 --- a/constant/version.go +++ b/constant/version.go @@ -1,8 +1,8 @@ package constant var ( - Meta = true - Version = "1.10.0" - BuildTime = "unknown time" - ClashName = "clash.meta" + Meta = true + Version = "1.10.0" + BuildTime = "unknown time" + MihomoName = "mihomo" ) diff --git a/context/conn.go b/context/conn.go index afeed852..bae07c23 100644 --- a/context/conn.go +++ b/context/conn.go @@ -1,11 +1,11 @@ package context import ( - "github.com/Dreamacro/clash/common/utils" + "github.com/metacubex/mihomo/common/utils" "net" - N "github.com/Dreamacro/clash/common/net" - C "github.com/Dreamacro/clash/constant" + N "github.com/metacubex/mihomo/common/net" + C "github.com/metacubex/mihomo/constant" "github.com/gofrs/uuid/v5" ) diff --git a/context/dns.go b/context/dns.go index ae29154f..1cc2067d 100644 --- a/context/dns.go +++ b/context/dns.go @@ -2,7 +2,7 @@ package context import ( "context" - "github.com/Dreamacro/clash/common/utils" + "github.com/metacubex/mihomo/common/utils" "github.com/gofrs/uuid/v5" "github.com/miekg/dns" diff --git a/context/packetconn.go b/context/packetconn.go index d695bae5..feab7666 100644 --- a/context/packetconn.go +++ b/context/packetconn.go @@ -3,8 +3,8 @@ package context import ( "net" - "github.com/Dreamacro/clash/common/utils" - C "github.com/Dreamacro/clash/constant" + "github.com/metacubex/mihomo/common/utils" + C "github.com/metacubex/mihomo/constant" "github.com/gofrs/uuid/v5" ) diff --git a/dns/client.go b/dns/client.go index 5cdd1ec0..95f0f29b 100644 --- a/dns/client.go +++ b/dns/client.go @@ -8,10 +8,10 @@ import ( "net/netip" "strings" - "github.com/Dreamacro/clash/component/ca" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/resolver" - C "github.com/Dreamacro/clash/constant" + "github.com/metacubex/mihomo/component/ca" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/resolver" + C "github.com/metacubex/mihomo/constant" D "github.com/miekg/dns" "github.com/zhangyunhao116/fastrand" diff --git a/dns/dhcp.go b/dns/dhcp.go index 70f9aeeb..dc1344f5 100644 --- a/dns/dhcp.go +++ b/dns/dhcp.go @@ -8,8 +8,8 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/component/dhcp" - "github.com/Dreamacro/clash/component/iface" + "github.com/metacubex/mihomo/component/dhcp" + "github.com/metacubex/mihomo/component/iface" D "github.com/miekg/dns" ) diff --git a/dns/doh.go b/dns/doh.go index 488e9025..9e173c84 100644 --- a/dns/doh.go +++ b/dns/doh.go @@ -15,9 +15,9 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/component/ca" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/component/ca" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" "github.com/metacubex/quic-go" "github.com/metacubex/quic-go/http3" D "github.com/miekg/dns" diff --git a/dns/doq.go b/dns/doq.go index 76da913f..70b67c2a 100644 --- a/dns/doq.go +++ b/dns/doq.go @@ -12,9 +12,9 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/component/ca" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/component/ca" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" "github.com/metacubex/quic-go" D "github.com/miekg/dns" diff --git a/dns/enhancer.go b/dns/enhancer.go index ab144fd3..82fdd35a 100644 --- a/dns/enhancer.go +++ b/dns/enhancer.go @@ -3,9 +3,9 @@ package dns import ( "net/netip" - "github.com/Dreamacro/clash/common/cache" - "github.com/Dreamacro/clash/component/fakeip" - C "github.com/Dreamacro/clash/constant" + "github.com/metacubex/mihomo/common/cache" + "github.com/metacubex/mihomo/component/fakeip" + C "github.com/metacubex/mihomo/constant" ) type ResolverEnhancer struct { diff --git a/dns/filters.go b/dns/filters.go index f7e953e8..8eb1e48e 100644 --- a/dns/filters.go +++ b/dns/filters.go @@ -4,12 +4,12 @@ import ( "net/netip" "strings" - "github.com/Dreamacro/clash/component/geodata" - "github.com/Dreamacro/clash/component/geodata/router" - "github.com/Dreamacro/clash/component/mmdb" - "github.com/Dreamacro/clash/component/trie" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/component/geodata" + "github.com/metacubex/mihomo/component/geodata/router" + "github.com/metacubex/mihomo/component/mmdb" + "github.com/metacubex/mihomo/component/trie" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" ) type fallbackIPFilter interface { diff --git a/dns/middleware.go b/dns/middleware.go index 695432da..f8e051a0 100644 --- a/dns/middleware.go +++ b/dns/middleware.go @@ -5,13 +5,13 @@ import ( "strings" "time" - "github.com/Dreamacro/clash/common/cache" - "github.com/Dreamacro/clash/common/nnip" - "github.com/Dreamacro/clash/component/fakeip" - R "github.com/Dreamacro/clash/component/resolver" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/context" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/common/cache" + "github.com/metacubex/mihomo/common/nnip" + "github.com/metacubex/mihomo/component/fakeip" + R "github.com/metacubex/mihomo/component/resolver" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/context" + "github.com/metacubex/mihomo/log" D "github.com/miekg/dns" ) diff --git a/dns/resolver.go b/dns/resolver.go index d27f7bcc..610a06f0 100644 --- a/dns/resolver.go +++ b/dns/resolver.go @@ -7,14 +7,14 @@ import ( "strings" "time" - "github.com/Dreamacro/clash/common/cache" - "github.com/Dreamacro/clash/component/fakeip" - "github.com/Dreamacro/clash/component/geodata/router" - "github.com/Dreamacro/clash/component/resolver" - "github.com/Dreamacro/clash/component/trie" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/constant/provider" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/common/cache" + "github.com/metacubex/mihomo/component/fakeip" + "github.com/metacubex/mihomo/component/geodata/router" + "github.com/metacubex/mihomo/component/resolver" + "github.com/metacubex/mihomo/component/trie" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/constant/provider" + "github.com/metacubex/mihomo/log" D "github.com/miekg/dns" "github.com/samber/lo" diff --git a/dns/server.go b/dns/server.go index 5c5970db..1cf58d4d 100644 --- a/dns/server.go +++ b/dns/server.go @@ -5,9 +5,9 @@ import ( "errors" "net" - "github.com/Dreamacro/clash/common/sockopt" - "github.com/Dreamacro/clash/context" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/common/sockopt" + "github.com/metacubex/mihomo/context" + "github.com/metacubex/mihomo/log" D "github.com/miekg/dns" ) diff --git a/dns/system.go b/dns/system.go index 20282929..37607a60 100644 --- a/dns/system.go +++ b/dns/system.go @@ -8,7 +8,7 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/log" D "github.com/miekg/dns" "golang.org/x/exp/slices" diff --git a/dns/util.go b/dns/util.go index 34f7aa94..c354a73d 100644 --- a/dns/util.go +++ b/dns/util.go @@ -11,15 +11,15 @@ import ( "strings" "time" - "github.com/Dreamacro/clash/common/cache" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/nnip" - "github.com/Dreamacro/clash/common/picker" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/resolver" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" - "github.com/Dreamacro/clash/tunnel" + "github.com/metacubex/mihomo/common/cache" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/nnip" + "github.com/metacubex/mihomo/common/picker" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/resolver" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/tunnel" D "github.com/miekg/dns" "github.com/samber/lo" diff --git a/docker/file-name.sh b/docker/file-name.sh index 1ac2cee0..3b2d61f9 100644 --- a/docker/file-name.sh +++ b/docker/file-name.sh @@ -1,5 +1,5 @@ #!/bin/sh -os="clash.meta-linux-" +os="mihomo-linux-" case $TARGETPLATFORM in "linux/amd64") arch="amd64-compatible" diff --git a/docs/config.yaml b/docs/config.yaml index 61a2dee9..d5e1174a 100644 --- a/docs/config.yaml +++ b/docs/config.yaml @@ -16,7 +16,7 @@ skip-auth-prefixes: # 设置跳过验证的IP段 # find-process-mode has 3 values:always, strict, off # - always, 开启,强制匹配所有进程 -# - strict, 默认,由 clash 判断是否开启 +# - strict, 默认,由 mihomo 判断是否开启 # - off, 不匹配进程,推荐在路由器上使用此模式 find-process-mode: strict @@ -74,11 +74,11 @@ experimental: # 类似于 /etc/hosts, 仅支持配置单个 IP hosts: -# '*.clash.dev': 127.0.0.1 +# '*.mihomo.dev': 127.0.0.1 # '.dev': 127.0.0.1 -# 'alpha.clash.dev': '::1' +# 'alpha.mihomo.dev': '::1' # test.com: [1.1.1.1, 2.2.2.2] -# clash.lan: clash # clash 为特别字段,将加入本地所有网卡的地址 +# mihomo.lan: mihomo # mihomo 为特别字段,将加入本地所有网卡的地址 # baidu.com: google.com # 只允许配置一个别名 profile: # 存储 select 选择记录 @@ -754,7 +754,7 @@ proxies: # socks5 proxy-groups: # 代理链,目前relay可以支持udp的只有vmess/vless/trojan/ss/ssr/tuic # wireguard目前不支持在relay中使用,请使用proxy中的dialer-proxy配置项 - # Traffic: clash <-> http <-> vmess <-> ss1 <-> ss2 <-> Internet + # Traffic: mihomo <-> http <-> vmess <-> ss1 <-> ss2 <-> Internet - name: "relay" type: relay proxies: @@ -823,13 +823,13 @@ proxy-groups: - Proxy - DIRECT -# Clash 格式的节点或支持 *ray 的分享格式 +# Mihomo 格式的节点或支持 *ray 的分享格式 proxy-providers: provider1: type: http # http 的 path 可空置,默认储存路径为 homedir的proxies文件夹,文件名为url的md5 url: "url" interval: 3600 - path: ./provider1.yaml # 默认只允许存储在 clash 的 Home Dir,如果想存储到任意位置,添加环境变量 SKIP_SAFE_PATH_CHECK=1 + path: ./provider1.yaml # 默认只允许存储在 mihomo 的 Home Dir,如果想存储到任意位置,添加环境变量 SKIP_SAFE_PATH_CHECK=1 health-check: enable: true interval: 600 @@ -846,7 +846,7 @@ rule-providers: rule1: behavior: classical # domain ipcidr interval: 259200 - path: /path/to/save/file.yaml # 默认只允许存储在 clash 的 Home Dir,如果想存储到任意位置,添加环境变量 SKIP_SAFE_PATH_CHECK=1 + path: /path/to/save/file.yaml # 默认只允许存储在 mihomo 的 Home Dir,如果想存储到任意位置,添加环境变量 SKIP_SAFE_PATH_CHECK=1 type: http # http 的 path 可空置,默认储存路径为 homedir的rules文件夹,文件名为url的md5 url: "url" rule2: diff --git a/flake.nix b/flake.nix index ffd18629..afe6e1c1 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Another Clash Kernel"; + description = "Another Mihomo Kernel"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/master"; @@ -15,7 +15,7 @@ }; in rec { - packages.default = pkgs.clash-meta; + packages.default = pkgs.mihomo-meta; } ) // ( @@ -23,8 +23,8 @@ { overlay = final: prev: { - clash-meta = final.buildGo119Module { - pname = "clash-meta"; + mihomo-meta = final.buildGo119Module { + pname = "mihomo-meta"; inherit version; src = ./.; @@ -38,8 +38,8 @@ ldflags = [ "-s" "-w" - "-X github.com/Dreamacro/clash/constant.Version=dev-${version}" - "-X github.com/Dreamacro/clash/constant.BuildTime=${version}" + "-X github.com/metacubex/mihomo/constant.Version=dev-${version}" + "-X github.com/metacubex/mihomo/constant.BuildTime=${version}" ]; tags = [ @@ -50,7 +50,7 @@ doCheck = false; postInstall = '' - mv $out/bin/clash $out/bin/clash-meta + mv $out/bin/mihomo $out/bin/mihomo-meta ''; }; diff --git a/go.mod b/go.mod index 80ab477c..da45cd28 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/Dreamacro/clash +module github.com/metacubex/mihomo go 1.20 diff --git a/hub/executor/executor.go b/hub/executor/executor.go index 87e0e0b1..6ea02989 100644 --- a/hub/executor/executor.go +++ b/hub/executor/executor.go @@ -11,32 +11,32 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/ntp" + "github.com/metacubex/mihomo/ntp" - "github.com/Dreamacro/clash/adapter" - "github.com/Dreamacro/clash/adapter/inbound" - "github.com/Dreamacro/clash/adapter/outboundgroup" - "github.com/Dreamacro/clash/component/auth" - "github.com/Dreamacro/clash/component/ca" - "github.com/Dreamacro/clash/component/dialer" - G "github.com/Dreamacro/clash/component/geodata" - "github.com/Dreamacro/clash/component/iface" - "github.com/Dreamacro/clash/component/profile" - "github.com/Dreamacro/clash/component/profile/cachefile" - "github.com/Dreamacro/clash/component/resolver" - SNI "github.com/Dreamacro/clash/component/sniffer" - "github.com/Dreamacro/clash/component/trie" - "github.com/Dreamacro/clash/config" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/constant/provider" - "github.com/Dreamacro/clash/dns" - "github.com/Dreamacro/clash/listener" - authStore "github.com/Dreamacro/clash/listener/auth" - LC "github.com/Dreamacro/clash/listener/config" - "github.com/Dreamacro/clash/listener/inner" - "github.com/Dreamacro/clash/listener/tproxy" - "github.com/Dreamacro/clash/log" - "github.com/Dreamacro/clash/tunnel" + "github.com/metacubex/mihomo/adapter" + "github.com/metacubex/mihomo/adapter/inbound" + "github.com/metacubex/mihomo/adapter/outboundgroup" + "github.com/metacubex/mihomo/component/auth" + "github.com/metacubex/mihomo/component/ca" + "github.com/metacubex/mihomo/component/dialer" + G "github.com/metacubex/mihomo/component/geodata" + "github.com/metacubex/mihomo/component/iface" + "github.com/metacubex/mihomo/component/profile" + "github.com/metacubex/mihomo/component/profile/cachefile" + "github.com/metacubex/mihomo/component/resolver" + SNI "github.com/metacubex/mihomo/component/sniffer" + "github.com/metacubex/mihomo/component/trie" + "github.com/metacubex/mihomo/config" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/constant/provider" + "github.com/metacubex/mihomo/dns" + "github.com/metacubex/mihomo/listener" + authStore "github.com/metacubex/mihomo/listener/auth" + LC "github.com/metacubex/mihomo/listener/config" + "github.com/metacubex/mihomo/listener/inner" + "github.com/metacubex/mihomo/listener/tproxy" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/tunnel" ) var mux sync.Mutex @@ -505,5 +505,5 @@ func Shutdown() { tproxy.CleanupTProxyIPTables() resolver.StoreFakePoolState() - log.Warnln("Clash shutting down") + log.Warnln("Mihomo shutting down") } diff --git a/hub/hub.go b/hub/hub.go index bd228fad..323f8749 100644 --- a/hub/hub.go +++ b/hub/hub.go @@ -1,10 +1,10 @@ package hub import ( - "github.com/Dreamacro/clash/config" - "github.com/Dreamacro/clash/hub/executor" - "github.com/Dreamacro/clash/hub/route" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/config" + "github.com/metacubex/mihomo/hub/executor" + "github.com/metacubex/mihomo/hub/route" + "github.com/metacubex/mihomo/log" ) type Option func(*config.Config) @@ -27,7 +27,7 @@ func WithSecret(secret string) Option { } } -// Parse call at the beginning of clash +// Parse call at the beginning of mihomo func Parse(options ...Option) error { cfg, err := executor.Parse() if err != nil { diff --git a/hub/route/cache.go b/hub/route/cache.go index bdfd2e35..f07eb33a 100644 --- a/hub/route/cache.go +++ b/hub/route/cache.go @@ -3,7 +3,7 @@ package route import ( "net/http" - "github.com/Dreamacro/clash/component/resolver" + "github.com/metacubex/mihomo/component/resolver" "github.com/go-chi/chi/v5" "github.com/go-chi/render" diff --git a/hub/route/configs.go b/hub/route/configs.go index e86bb2a8..3b5f62b3 100644 --- a/hub/route/configs.go +++ b/hub/route/configs.go @@ -6,17 +6,17 @@ import ( "path/filepath" "sync" - "github.com/Dreamacro/clash/adapter/inbound" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/resolver" - "github.com/Dreamacro/clash/config" - "github.com/Dreamacro/clash/constant" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/hub/executor" - P "github.com/Dreamacro/clash/listener" - LC "github.com/Dreamacro/clash/listener/config" - "github.com/Dreamacro/clash/log" - "github.com/Dreamacro/clash/tunnel" + "github.com/metacubex/mihomo/adapter/inbound" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/resolver" + "github.com/metacubex/mihomo/config" + "github.com/metacubex/mihomo/constant" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/hub/executor" + P "github.com/metacubex/mihomo/listener" + LC "github.com/metacubex/mihomo/listener/config" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/tunnel" "github.com/go-chi/chi/v5" "github.com/go-chi/render" diff --git a/hub/route/connections.go b/hub/route/connections.go index 67d5afa3..e0ff2426 100644 --- a/hub/route/connections.go +++ b/hub/route/connections.go @@ -7,7 +7,7 @@ import ( "strconv" "time" - "github.com/Dreamacro/clash/tunnel/statistic" + "github.com/metacubex/mihomo/tunnel/statistic" "github.com/go-chi/chi/v5" "github.com/go-chi/render" diff --git a/hub/route/ctxkeys.go b/hub/route/ctxkeys.go index 56370192..6883b208 100644 --- a/hub/route/ctxkeys.go +++ b/hub/route/ctxkeys.go @@ -10,5 +10,5 @@ var ( type contextKey string func (c contextKey) String() string { - return "clash context key " + string(c) + return "mihomo context key " + string(c) } diff --git a/hub/route/dns.go b/hub/route/dns.go index 2918b059..1762c947 100644 --- a/hub/route/dns.go +++ b/hub/route/dns.go @@ -5,7 +5,7 @@ import ( "math" "net/http" - "github.com/Dreamacro/clash/component/resolver" + "github.com/metacubex/mihomo/component/resolver" "github.com/go-chi/chi/v5" "github.com/go-chi/render" diff --git a/hub/route/groups.go b/hub/route/groups.go index c82207f0..e36b8ab0 100644 --- a/hub/route/groups.go +++ b/hub/route/groups.go @@ -8,11 +8,11 @@ import ( "strconv" "time" - "github.com/Dreamacro/clash/adapter" - "github.com/Dreamacro/clash/adapter/outboundgroup" - "github.com/Dreamacro/clash/common/utils" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/tunnel" + "github.com/metacubex/mihomo/adapter" + "github.com/metacubex/mihomo/adapter/outboundgroup" + "github.com/metacubex/mihomo/common/utils" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/tunnel" ) func GroupRouter() http.Handler { diff --git a/hub/route/provider.go b/hub/route/provider.go index c050a9f1..a8611a79 100644 --- a/hub/route/provider.go +++ b/hub/route/provider.go @@ -4,9 +4,9 @@ import ( "context" "net/http" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/constant/provider" - "github.com/Dreamacro/clash/tunnel" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/constant/provider" + "github.com/metacubex/mihomo/tunnel" "github.com/go-chi/chi/v5" "github.com/go-chi/render" diff --git a/hub/route/proxies.go b/hub/route/proxies.go index c1e30b21..759e64d2 100644 --- a/hub/route/proxies.go +++ b/hub/route/proxies.go @@ -7,12 +7,12 @@ import ( "strconv" "time" - "github.com/Dreamacro/clash/adapter" - "github.com/Dreamacro/clash/adapter/outboundgroup" - "github.com/Dreamacro/clash/common/utils" - "github.com/Dreamacro/clash/component/profile/cachefile" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/tunnel" + "github.com/metacubex/mihomo/adapter" + "github.com/metacubex/mihomo/adapter/outboundgroup" + "github.com/metacubex/mihomo/common/utils" + "github.com/metacubex/mihomo/component/profile/cachefile" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/tunnel" "github.com/go-chi/chi/v5" "github.com/go-chi/render" diff --git a/hub/route/restart.go b/hub/route/restart.go index a907021f..49d7e517 100644 --- a/hub/route/restart.go +++ b/hub/route/restart.go @@ -8,8 +8,8 @@ import ( "runtime" "syscall" - "github.com/Dreamacro/clash/hub/executor" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/hub/executor" + "github.com/metacubex/mihomo/log" "github.com/go-chi/chi/v5" "github.com/go-chi/render" diff --git a/hub/route/rules.go b/hub/route/rules.go index 51f8f01c..43d33299 100644 --- a/hub/route/rules.go +++ b/hub/route/rules.go @@ -1,10 +1,10 @@ package route import ( - "github.com/Dreamacro/clash/constant" + "github.com/metacubex/mihomo/constant" "net/http" - "github.com/Dreamacro/clash/tunnel" + "github.com/metacubex/mihomo/tunnel" "github.com/go-chi/chi/v5" "github.com/go-chi/render" diff --git a/hub/route/server.go b/hub/route/server.go index 93afd989..d510e986 100644 --- a/hub/route/server.go +++ b/hub/route/server.go @@ -11,12 +11,12 @@ import ( "strings" "time" - "github.com/Dreamacro/clash/adapter/inbound" - CN "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/utils" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" - "github.com/Dreamacro/clash/tunnel/statistic" + "github.com/metacubex/mihomo/adapter/inbound" + CN "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/utils" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/tunnel/statistic" "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" @@ -189,7 +189,7 @@ func authentication(next http.Handler) http.Handler { } func hello(w http.ResponseWriter, r *http.Request) { - render.JSON(w, r, render.M{"hello": "clash.meta"}) + render.JSON(w, r, render.M{"hello": "mihomo"}) } func traffic(w http.ResponseWriter, r *http.Request) { diff --git a/hub/route/upgrade.go b/hub/route/upgrade.go index 7b486ee3..ea371798 100644 --- a/hub/route/upgrade.go +++ b/hub/route/upgrade.go @@ -6,9 +6,9 @@ import ( "net/http" "os" - "github.com/Dreamacro/clash/config" - "github.com/Dreamacro/clash/hub/updater" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/config" + "github.com/metacubex/mihomo/hub/updater" + "github.com/metacubex/mihomo/log" "github.com/go-chi/chi/v5" "github.com/go-chi/render" diff --git a/hub/updater/updater.go b/hub/updater/updater.go index 1a930c03..a3bc9a42 100644 --- a/hub/updater/updater.go +++ b/hub/updater/updater.go @@ -15,15 +15,15 @@ import ( "sync" "time" - clashHttp "github.com/Dreamacro/clash/component/http" - "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + mihomoHttp "github.com/metacubex/mihomo/component/http" + "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" "github.com/klauspost/cpuid/v2" ) // modify from https://github.com/AdguardTeam/AdGuardHome/blob/595484e0b3fb4c457f9bb727a6b94faa78a66c5f/internal/updater/updater.go -// Updater is the Clash.Meta updater. +// Updater is the mihomo updater. var ( goarm string gomips string @@ -41,8 +41,8 @@ var ( backupExeName string // 备份文件名 updateExeName string // 更新后的可执行文件 - baseURL string = "https://github.com/MetaCubeX/Clash.Meta/releases/download/Prerelease-Alpha/clash.meta" - versionURL string = "https://github.com/MetaCubeX/Clash.Meta/releases/download/Prerelease-Alpha/version.txt" + baseURL string = "https://github.com/MetaCubeX/mihomo/releases/download/Prerelease-Alpha/mihomo" + versionURL string = "https://github.com/MetaCubeX/mihomo/releases/download/Prerelease-Alpha/version.txt" packageURL string latestVersion string ) @@ -135,9 +135,9 @@ func prepare(exePath string) (err error) { backupDir = filepath.Join(workDir, "meta-backup") if runtime.GOOS == "windows" { - updateExeName = "clash.meta" + "-" + runtime.GOOS + "-" + runtime.GOARCH + amd64Compatible + ".exe" + updateExeName = "mihomo" + "-" + runtime.GOOS + "-" + runtime.GOARCH + amd64Compatible + ".exe" } else { - updateExeName = "clash.meta" + "-" + runtime.GOOS + "-" + runtime.GOARCH + amd64Compatible + updateExeName = "mihomo" + "-" + runtime.GOOS + "-" + runtime.GOARCH + amd64Compatible } log.Infoln("updateExeName: %s ", updateExeName) @@ -231,7 +231,7 @@ const MaxPackageFileSize = 32 * 1024 * 1024 func downloadPackageFile() (err error) { ctx, cancel := context.WithTimeout(context.Background(), time.Second*90) defer cancel() - resp, err := clashHttp.HttpRequest(ctx, packageURL, http.MethodGet, http.Header{"User-Agent": {"clash"}}, nil) + resp, err := mihomoHttp.HttpRequest(ctx, packageURL, http.MethodGet, http.Header{"User-Agent": {"mihomo"}}, nil) if err != nil { return fmt.Errorf("http request failed: %w", err) } @@ -412,7 +412,7 @@ func copyFile(src, dst string) error { func getLatestVersion() (version string, err error) { ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) defer cancel() - resp, err := clashHttp.HttpRequest(ctx, versionURL, http.MethodGet, http.Header{"User-Agent": {"clash"}}, nil) + resp, err := mihomoHttp.HttpRequest(ctx, versionURL, http.MethodGet, http.Header{"User-Agent": {"mihomo"}}, nil) if err != nil { return "", fmt.Errorf("get Latest Version fail: %w", err) } diff --git a/listener/auth/auth.go b/listener/auth/auth.go index 70473114..46f552b8 100644 --- a/listener/auth/auth.go +++ b/listener/auth/auth.go @@ -1,7 +1,7 @@ package auth import ( - "github.com/Dreamacro/clash/component/auth" + "github.com/metacubex/mihomo/component/auth" ) var authenticator auth.Authenticator diff --git a/listener/autoredir/tcp.go b/listener/autoredir/tcp.go index 57df45f3..2b21b087 100644 --- a/listener/autoredir/tcp.go +++ b/listener/autoredir/tcp.go @@ -4,11 +4,11 @@ import ( "net" "net/netip" - "github.com/Dreamacro/clash/adapter/inbound" - N "github.com/Dreamacro/clash/common/net" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/adapter/inbound" + N "github.com/metacubex/mihomo/common/net" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/transport/socks5" ) type Listener struct { diff --git a/listener/config/tun.go b/listener/config/tun.go index 3f151d1e..6db1fd66 100644 --- a/listener/config/tun.go +++ b/listener/config/tun.go @@ -3,7 +3,7 @@ package config import ( "net/netip" - C "github.com/Dreamacro/clash/constant" + C "github.com/metacubex/mihomo/constant" ) func StringSliceToNetipPrefixSlice(ss []string) ([]netip.Prefix, error) { diff --git a/listener/http/client.go b/listener/http/client.go index 84c284ff..c35cadad 100644 --- a/listener/http/client.go +++ b/listener/http/client.go @@ -7,9 +7,9 @@ import ( "net/http" "time" - "github.com/Dreamacro/clash/adapter/inbound" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/adapter/inbound" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/socks5" ) func newClient(srcConn net.Conn, tunnel C.Tunnel, additions ...inbound.Addition) *http.Client { diff --git a/listener/http/proxy.go b/listener/http/proxy.go index fa1d8f88..76da4d95 100644 --- a/listener/http/proxy.go +++ b/listener/http/proxy.go @@ -6,12 +6,12 @@ import ( "net/http" "strings" - "github.com/Dreamacro/clash/adapter/inbound" - "github.com/Dreamacro/clash/common/cache" - N "github.com/Dreamacro/clash/common/net" - C "github.com/Dreamacro/clash/constant" - authStore "github.com/Dreamacro/clash/listener/auth" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/adapter/inbound" + "github.com/metacubex/mihomo/common/cache" + N "github.com/metacubex/mihomo/common/net" + C "github.com/metacubex/mihomo/constant" + authStore "github.com/metacubex/mihomo/listener/auth" + "github.com/metacubex/mihomo/log" ) func HandleConn(c net.Conn, tunnel C.Tunnel, cache *cache.LruCache[string, bool], additions ...inbound.Addition) { diff --git a/listener/http/server.go b/listener/http/server.go index 0377d3b6..a75e2092 100644 --- a/listener/http/server.go +++ b/listener/http/server.go @@ -3,9 +3,9 @@ package http import ( "net" - "github.com/Dreamacro/clash/adapter/inbound" - "github.com/Dreamacro/clash/common/cache" - C "github.com/Dreamacro/clash/constant" + "github.com/metacubex/mihomo/adapter/inbound" + "github.com/metacubex/mihomo/common/cache" + C "github.com/metacubex/mihomo/constant" ) type Listener struct { diff --git a/listener/http/upgrade.go b/listener/http/upgrade.go index 6e4f063d..8a6291d1 100644 --- a/listener/http/upgrade.go +++ b/listener/http/upgrade.go @@ -7,10 +7,10 @@ import ( "net/http" "strings" - "github.com/Dreamacro/clash/adapter/inbound" - N "github.com/Dreamacro/clash/common/net" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/adapter/inbound" + N "github.com/metacubex/mihomo/common/net" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/socks5" ) func isUpgradeRequest(req *http.Request) bool { diff --git a/listener/inbound/base.go b/listener/inbound/base.go index 83695bb1..e8f860a0 100644 --- a/listener/inbound/base.go +++ b/listener/inbound/base.go @@ -6,8 +6,8 @@ import ( "net/netip" "strconv" - "github.com/Dreamacro/clash/adapter/inbound" - C "github.com/Dreamacro/clash/constant" + "github.com/metacubex/mihomo/adapter/inbound" + C "github.com/metacubex/mihomo/constant" ) type Base struct { diff --git a/listener/inbound/http.go b/listener/inbound/http.go index 99577177..f5301f46 100644 --- a/listener/inbound/http.go +++ b/listener/inbound/http.go @@ -1,9 +1,9 @@ package inbound import ( - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/listener/http" - "github.com/Dreamacro/clash/log" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/listener/http" + "github.com/metacubex/mihomo/log" ) type HTTPOption struct { diff --git a/listener/inbound/hysteria2.go b/listener/inbound/hysteria2.go index df537a41..112d03f8 100644 --- a/listener/inbound/hysteria2.go +++ b/listener/inbound/hysteria2.go @@ -1,10 +1,10 @@ package inbound import ( - C "github.com/Dreamacro/clash/constant" - LC "github.com/Dreamacro/clash/listener/config" - "github.com/Dreamacro/clash/listener/sing_hysteria2" - "github.com/Dreamacro/clash/log" + C "github.com/metacubex/mihomo/constant" + LC "github.com/metacubex/mihomo/listener/config" + "github.com/metacubex/mihomo/listener/sing_hysteria2" + "github.com/metacubex/mihomo/log" ) type Hysteria2Option struct { diff --git a/listener/inbound/mixed.go b/listener/inbound/mixed.go index ce445bda..fc643821 100644 --- a/listener/inbound/mixed.go +++ b/listener/inbound/mixed.go @@ -3,11 +3,11 @@ package inbound import ( "fmt" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" - "github.com/Dreamacro/clash/listener/mixed" - "github.com/Dreamacro/clash/listener/socks" + "github.com/metacubex/mihomo/listener/mixed" + "github.com/metacubex/mihomo/listener/socks" ) type MixedOption struct { diff --git a/listener/inbound/redir.go b/listener/inbound/redir.go index 085bf3a8..ee090ade 100644 --- a/listener/inbound/redir.go +++ b/listener/inbound/redir.go @@ -1,9 +1,9 @@ package inbound import ( - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/listener/redir" - "github.com/Dreamacro/clash/log" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/listener/redir" + "github.com/metacubex/mihomo/log" ) type RedirOption struct { diff --git a/listener/inbound/shadowsocks.go b/listener/inbound/shadowsocks.go index fa5b3082..cb32dcfb 100644 --- a/listener/inbound/shadowsocks.go +++ b/listener/inbound/shadowsocks.go @@ -1,10 +1,10 @@ package inbound import ( - C "github.com/Dreamacro/clash/constant" - LC "github.com/Dreamacro/clash/listener/config" - "github.com/Dreamacro/clash/listener/sing_shadowsocks" - "github.com/Dreamacro/clash/log" + C "github.com/metacubex/mihomo/constant" + LC "github.com/metacubex/mihomo/listener/config" + "github.com/metacubex/mihomo/listener/sing_shadowsocks" + "github.com/metacubex/mihomo/log" ) type ShadowSocksOption struct { diff --git a/listener/inbound/socks.go b/listener/inbound/socks.go index 09580a57..7e10d93a 100644 --- a/listener/inbound/socks.go +++ b/listener/inbound/socks.go @@ -2,9 +2,9 @@ package inbound import ( "fmt" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/listener/socks" - "github.com/Dreamacro/clash/log" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/listener/socks" + "github.com/metacubex/mihomo/log" ) type SocksOption struct { diff --git a/listener/inbound/tproxy.go b/listener/inbound/tproxy.go index 682188f5..acc8cb5e 100644 --- a/listener/inbound/tproxy.go +++ b/listener/inbound/tproxy.go @@ -3,9 +3,9 @@ package inbound import ( "fmt" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/listener/tproxy" - "github.com/Dreamacro/clash/log" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/listener/tproxy" + "github.com/metacubex/mihomo/log" ) type TProxyOption struct { diff --git a/listener/inbound/tuic.go b/listener/inbound/tuic.go index e7b51392..c2a73b84 100644 --- a/listener/inbound/tuic.go +++ b/listener/inbound/tuic.go @@ -1,10 +1,10 @@ package inbound import ( - C "github.com/Dreamacro/clash/constant" - LC "github.com/Dreamacro/clash/listener/config" - "github.com/Dreamacro/clash/listener/tuic" - "github.com/Dreamacro/clash/log" + C "github.com/metacubex/mihomo/constant" + LC "github.com/metacubex/mihomo/listener/config" + "github.com/metacubex/mihomo/listener/tuic" + "github.com/metacubex/mihomo/log" ) type TuicOption struct { diff --git a/listener/inbound/tun.go b/listener/inbound/tun.go index 472269d6..d1044b8e 100644 --- a/listener/inbound/tun.go +++ b/listener/inbound/tun.go @@ -4,10 +4,10 @@ import ( "errors" "strings" - C "github.com/Dreamacro/clash/constant" - LC "github.com/Dreamacro/clash/listener/config" - "github.com/Dreamacro/clash/listener/sing_tun" - "github.com/Dreamacro/clash/log" + C "github.com/metacubex/mihomo/constant" + LC "github.com/metacubex/mihomo/listener/config" + "github.com/metacubex/mihomo/listener/sing_tun" + "github.com/metacubex/mihomo/log" ) type TunOption struct { diff --git a/listener/inbound/tunnel.go b/listener/inbound/tunnel.go index 2af663a5..2dfaac74 100644 --- a/listener/inbound/tunnel.go +++ b/listener/inbound/tunnel.go @@ -3,9 +3,9 @@ package inbound import ( "fmt" - C "github.com/Dreamacro/clash/constant" - LT "github.com/Dreamacro/clash/listener/tunnel" - "github.com/Dreamacro/clash/log" + C "github.com/metacubex/mihomo/constant" + LT "github.com/metacubex/mihomo/listener/tunnel" + "github.com/metacubex/mihomo/log" ) type TunnelOption struct { diff --git a/listener/inbound/vmess.go b/listener/inbound/vmess.go index 3f516198..3508aa3c 100644 --- a/listener/inbound/vmess.go +++ b/listener/inbound/vmess.go @@ -1,10 +1,10 @@ package inbound import ( - C "github.com/Dreamacro/clash/constant" - LC "github.com/Dreamacro/clash/listener/config" - "github.com/Dreamacro/clash/listener/sing_vmess" - "github.com/Dreamacro/clash/log" + C "github.com/metacubex/mihomo/constant" + LC "github.com/metacubex/mihomo/listener/config" + "github.com/metacubex/mihomo/listener/sing_vmess" + "github.com/metacubex/mihomo/log" ) type VmessOption struct { diff --git a/listener/inner/tcp.go b/listener/inner/tcp.go index 8973c431..373fd2b4 100644 --- a/listener/inner/tcp.go +++ b/listener/inner/tcp.go @@ -6,7 +6,7 @@ import ( "net/netip" "strconv" - C "github.com/Dreamacro/clash/constant" + C "github.com/metacubex/mihomo/constant" ) var tunnel C.Tunnel @@ -26,7 +26,7 @@ func HandleTcp(address string) (conn net.Conn, err error) { metadata.NetWork = C.TCP metadata.Type = C.INNER metadata.DNSMode = C.DNSNormal - metadata.Process = C.ClashName + metadata.Process = C.MihomoName if h, port, err := net.SplitHostPort(address); err == nil { if port, err := strconv.ParseUint(port, 10, 16); err == nil { metadata.DstPort = uint16(port) diff --git a/listener/listener.go b/listener/listener.go index a6bbdbf5..903cb64b 100644 --- a/listener/listener.go +++ b/listener/listener.go @@ -9,22 +9,22 @@ import ( "strings" "sync" - "github.com/Dreamacro/clash/component/ebpf" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/listener/autoredir" - LC "github.com/Dreamacro/clash/listener/config" - "github.com/Dreamacro/clash/listener/http" - "github.com/Dreamacro/clash/listener/mixed" - "github.com/Dreamacro/clash/listener/redir" - embedSS "github.com/Dreamacro/clash/listener/shadowsocks" - "github.com/Dreamacro/clash/listener/sing_shadowsocks" - "github.com/Dreamacro/clash/listener/sing_tun" - "github.com/Dreamacro/clash/listener/sing_vmess" - "github.com/Dreamacro/clash/listener/socks" - "github.com/Dreamacro/clash/listener/tproxy" - "github.com/Dreamacro/clash/listener/tuic" - LT "github.com/Dreamacro/clash/listener/tunnel" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/component/ebpf" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/listener/autoredir" + LC "github.com/metacubex/mihomo/listener/config" + "github.com/metacubex/mihomo/listener/http" + "github.com/metacubex/mihomo/listener/mixed" + "github.com/metacubex/mihomo/listener/redir" + embedSS "github.com/metacubex/mihomo/listener/shadowsocks" + "github.com/metacubex/mihomo/listener/sing_shadowsocks" + "github.com/metacubex/mihomo/listener/sing_tun" + "github.com/metacubex/mihomo/listener/sing_vmess" + "github.com/metacubex/mihomo/listener/socks" + "github.com/metacubex/mihomo/listener/tproxy" + "github.com/metacubex/mihomo/listener/tuic" + LT "github.com/metacubex/mihomo/listener/tunnel" + "github.com/metacubex/mihomo/log" "github.com/samber/lo" ) diff --git a/listener/mixed/mixed.go b/listener/mixed/mixed.go index d2ede096..97d1407c 100644 --- a/listener/mixed/mixed.go +++ b/listener/mixed/mixed.go @@ -3,14 +3,14 @@ package mixed import ( "net" - "github.com/Dreamacro/clash/adapter/inbound" - "github.com/Dreamacro/clash/common/cache" - N "github.com/Dreamacro/clash/common/net" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/listener/http" - "github.com/Dreamacro/clash/listener/socks" - "github.com/Dreamacro/clash/transport/socks4" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/adapter/inbound" + "github.com/metacubex/mihomo/common/cache" + N "github.com/metacubex/mihomo/common/net" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/listener/http" + "github.com/metacubex/mihomo/listener/socks" + "github.com/metacubex/mihomo/transport/socks4" + "github.com/metacubex/mihomo/transport/socks5" ) type Listener struct { diff --git a/listener/parse.go b/listener/parse.go index b0fac86a..1c8b6463 100644 --- a/listener/parse.go +++ b/listener/parse.go @@ -3,9 +3,9 @@ package listener import ( "fmt" - "github.com/Dreamacro/clash/common/structure" - C "github.com/Dreamacro/clash/constant" - IN "github.com/Dreamacro/clash/listener/inbound" + "github.com/metacubex/mihomo/common/structure" + C "github.com/metacubex/mihomo/constant" + IN "github.com/metacubex/mihomo/listener/inbound" ) func ParseListener(mapping map[string]any) (C.InboundListener, error) { diff --git a/listener/redir/tcp.go b/listener/redir/tcp.go index 6419760f..8474a8e2 100644 --- a/listener/redir/tcp.go +++ b/listener/redir/tcp.go @@ -3,9 +3,9 @@ package redir import ( "net" - "github.com/Dreamacro/clash/adapter/inbound" - N "github.com/Dreamacro/clash/common/net" - C "github.com/Dreamacro/clash/constant" + "github.com/metacubex/mihomo/adapter/inbound" + N "github.com/metacubex/mihomo/common/net" + C "github.com/metacubex/mihomo/constant" ) type Listener struct { diff --git a/listener/redir/tcp_darwin.go b/listener/redir/tcp_darwin.go index 5a2f331c..6e1821bb 100644 --- a/listener/redir/tcp_darwin.go +++ b/listener/redir/tcp_darwin.go @@ -5,7 +5,7 @@ import ( "syscall" "unsafe" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/transport/socks5" ) func parserPacket(c net.Conn) (socks5.Addr, error) { diff --git a/listener/redir/tcp_freebsd.go b/listener/redir/tcp_freebsd.go index 6ecb2496..9eb199f0 100644 --- a/listener/redir/tcp_freebsd.go +++ b/listener/redir/tcp_freebsd.go @@ -8,7 +8,7 @@ import ( "syscall" "unsafe" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/transport/socks5" "golang.org/x/sys/unix" ) diff --git a/listener/redir/tcp_linux.go b/listener/redir/tcp_linux.go index b65c34ee..fce74678 100644 --- a/listener/redir/tcp_linux.go +++ b/listener/redir/tcp_linux.go @@ -8,7 +8,7 @@ import ( "syscall" "unsafe" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/transport/socks5" "golang.org/x/sys/unix" ) diff --git a/listener/redir/tcp_other.go b/listener/redir/tcp_other.go index a01550c7..ae3bebfd 100644 --- a/listener/redir/tcp_other.go +++ b/listener/redir/tcp_other.go @@ -6,7 +6,7 @@ import ( "errors" "net" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/transport/socks5" ) func parserPacket(conn net.Conn) (socks5.Addr, error) { diff --git a/listener/shadowsocks/tcp.go b/listener/shadowsocks/tcp.go index 8959e6ba..c08667de 100644 --- a/listener/shadowsocks/tcp.go +++ b/listener/shadowsocks/tcp.go @@ -4,12 +4,12 @@ import ( "net" "strings" - "github.com/Dreamacro/clash/adapter/inbound" - N "github.com/Dreamacro/clash/common/net" - C "github.com/Dreamacro/clash/constant" - LC "github.com/Dreamacro/clash/listener/config" - "github.com/Dreamacro/clash/transport/shadowsocks/core" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/adapter/inbound" + N "github.com/metacubex/mihomo/common/net" + C "github.com/metacubex/mihomo/constant" + LC "github.com/metacubex/mihomo/listener/config" + "github.com/metacubex/mihomo/transport/shadowsocks/core" + "github.com/metacubex/mihomo/transport/socks5" ) type Listener struct { diff --git a/listener/shadowsocks/udp.go b/listener/shadowsocks/udp.go index 53f5549a..4336db22 100644 --- a/listener/shadowsocks/udp.go +++ b/listener/shadowsocks/udp.go @@ -3,13 +3,13 @@ package shadowsocks import ( "net" - "github.com/Dreamacro/clash/adapter/inbound" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/sockopt" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" - "github.com/Dreamacro/clash/transport/shadowsocks/core" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/adapter/inbound" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/sockopt" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/transport/shadowsocks/core" + "github.com/metacubex/mihomo/transport/socks5" ) type UDPListener struct { diff --git a/listener/shadowsocks/utils.go b/listener/shadowsocks/utils.go index a732cbbe..5d6a2977 100644 --- a/listener/shadowsocks/utils.go +++ b/listener/shadowsocks/utils.go @@ -6,7 +6,7 @@ import ( "net" "net/url" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/transport/socks5" ) type packet struct { diff --git a/listener/sing/context.go b/listener/sing/context.go index 4204757a..e1e8b452 100644 --- a/listener/sing/context.go +++ b/listener/sing/context.go @@ -4,7 +4,7 @@ import ( "context" "golang.org/x/exp/slices" - "github.com/Dreamacro/clash/adapter/inbound" + "github.com/metacubex/mihomo/adapter/inbound" "github.com/sagernet/sing/common/auth" ) diff --git a/listener/sing/sing.go b/listener/sing/sing.go index ff72f67d..306bd705 100644 --- a/listener/sing/sing.go +++ b/listener/sing/sing.go @@ -8,10 +8,10 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/adapter/inbound" - N "github.com/Dreamacro/clash/common/net" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/adapter/inbound" + N "github.com/metacubex/mihomo/common/net" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" vmess "github.com/metacubex/sing-vmess" mux "github.com/sagernet/sing-mux" diff --git a/listener/sing_hysteria2/server.go b/listener/sing_hysteria2/server.go index bc25ec2a..96553995 100644 --- a/listener/sing_hysteria2/server.go +++ b/listener/sing_hysteria2/server.go @@ -11,14 +11,14 @@ import ( "net/url" "strings" - "github.com/Dreamacro/clash/adapter/inbound" - "github.com/Dreamacro/clash/adapter/outbound" - CN "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/sockopt" - C "github.com/Dreamacro/clash/constant" - LC "github.com/Dreamacro/clash/listener/config" - "github.com/Dreamacro/clash/listener/sing" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/adapter/inbound" + "github.com/metacubex/mihomo/adapter/outbound" + CN "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/sockopt" + C "github.com/metacubex/mihomo/constant" + LC "github.com/metacubex/mihomo/listener/config" + "github.com/metacubex/mihomo/listener/sing" + "github.com/metacubex/mihomo/log" "github.com/metacubex/sing-quic/hysteria2" diff --git a/listener/sing_shadowsocks/server.go b/listener/sing_shadowsocks/server.go index 51baeaa1..5a4896af 100644 --- a/listener/sing_shadowsocks/server.go +++ b/listener/sing_shadowsocks/server.go @@ -6,15 +6,15 @@ import ( "net" "strings" - "github.com/Dreamacro/clash/adapter/inbound" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/sockopt" - C "github.com/Dreamacro/clash/constant" - LC "github.com/Dreamacro/clash/listener/config" - embedSS "github.com/Dreamacro/clash/listener/shadowsocks" - "github.com/Dreamacro/clash/listener/sing" - "github.com/Dreamacro/clash/log" - "github.com/Dreamacro/clash/ntp" + "github.com/metacubex/mihomo/adapter/inbound" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/sockopt" + C "github.com/metacubex/mihomo/constant" + LC "github.com/metacubex/mihomo/listener/config" + embedSS "github.com/metacubex/mihomo/listener/shadowsocks" + "github.com/metacubex/mihomo/listener/sing" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/ntp" shadowsocks "github.com/metacubex/sing-shadowsocks" "github.com/metacubex/sing-shadowsocks/shadowaead" diff --git a/listener/sing_tun/dns.go b/listener/sing_tun/dns.go index 88e3f6d6..62a15c6c 100644 --- a/listener/sing_tun/dns.go +++ b/listener/sing_tun/dns.go @@ -9,10 +9,10 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/common/pool" - "github.com/Dreamacro/clash/component/resolver" - "github.com/Dreamacro/clash/listener/sing" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/common/pool" + "github.com/metacubex/mihomo/component/resolver" + "github.com/metacubex/mihomo/listener/sing" + "github.com/metacubex/mihomo/log" D "github.com/miekg/dns" diff --git a/listener/sing_tun/server.go b/listener/sing_tun/server.go index 0548ac41..212c3d90 100644 --- a/listener/sing_tun/server.go +++ b/listener/sing_tun/server.go @@ -10,13 +10,13 @@ import ( "strings" "time" - "github.com/Dreamacro/clash/adapter/inbound" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/iface" - C "github.com/Dreamacro/clash/constant" - LC "github.com/Dreamacro/clash/listener/config" - "github.com/Dreamacro/clash/listener/sing" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/adapter/inbound" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/iface" + C "github.com/metacubex/mihomo/constant" + LC "github.com/metacubex/mihomo/listener/config" + "github.com/metacubex/mihomo/listener/sing" + "github.com/metacubex/mihomo/log" tun "github.com/metacubex/sing-tun" "github.com/sagernet/sing/common" diff --git a/listener/sing_tun/server_android.go b/listener/sing_tun/server_android.go index 4f85c418..ac41282d 100644 --- a/listener/sing_tun/server_android.go +++ b/listener/sing_tun/server_android.go @@ -1,7 +1,7 @@ package sing_tun import ( - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/log" tun "github.com/metacubex/sing-tun" "github.com/sagernet/netlink" "golang.org/x/sys/unix" diff --git a/listener/sing_tun/server_windows.go b/listener/sing_tun/server_windows.go index 9584f32f..8da21287 100644 --- a/listener/sing_tun/server_windows.go +++ b/listener/sing_tun/server_windows.go @@ -3,7 +3,7 @@ package sing_tun import ( "time" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/log" tun "github.com/metacubex/sing-tun" ) diff --git a/listener/sing_vmess/server.go b/listener/sing_vmess/server.go index 014e86f9..e790e3bc 100644 --- a/listener/sing_vmess/server.go +++ b/listener/sing_vmess/server.go @@ -8,13 +8,13 @@ import ( "net/url" "strings" - "github.com/Dreamacro/clash/adapter/inbound" - N "github.com/Dreamacro/clash/common/net" - C "github.com/Dreamacro/clash/constant" - LC "github.com/Dreamacro/clash/listener/config" - "github.com/Dreamacro/clash/listener/sing" - "github.com/Dreamacro/clash/ntp" - clashVMess "github.com/Dreamacro/clash/transport/vmess" + "github.com/metacubex/mihomo/adapter/inbound" + N "github.com/metacubex/mihomo/common/net" + C "github.com/metacubex/mihomo/constant" + LC "github.com/metacubex/mihomo/listener/config" + "github.com/metacubex/mihomo/listener/sing" + "github.com/metacubex/mihomo/ntp" + mihomoVMess "github.com/metacubex/mihomo/transport/vmess" vmess "github.com/metacubex/sing-vmess" "github.com/sagernet/sing/common" @@ -81,7 +81,7 @@ func New(config LC.VmessServer, tunnel C.Tunnel, additions ...inbound.Addition) if config.WsPath != "" { httpMux = http.NewServeMux() httpMux.HandleFunc(config.WsPath, func(w http.ResponseWriter, r *http.Request) { - conn, err := clashVMess.StreamUpgradedWebsocketConn(w, r) + conn, err := mihomoVMess.StreamUpgradedWebsocketConn(w, r) if err != nil { http.Error(w, err.Error(), 500) return diff --git a/listener/socks/tcp.go b/listener/socks/tcp.go index 9448f269..c8c33e7b 100644 --- a/listener/socks/tcp.go +++ b/listener/socks/tcp.go @@ -4,12 +4,12 @@ import ( "io" "net" - "github.com/Dreamacro/clash/adapter/inbound" - N "github.com/Dreamacro/clash/common/net" - C "github.com/Dreamacro/clash/constant" - authStore "github.com/Dreamacro/clash/listener/auth" - "github.com/Dreamacro/clash/transport/socks4" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/adapter/inbound" + N "github.com/metacubex/mihomo/common/net" + C "github.com/metacubex/mihomo/constant" + authStore "github.com/metacubex/mihomo/listener/auth" + "github.com/metacubex/mihomo/transport/socks4" + "github.com/metacubex/mihomo/transport/socks5" ) type Listener struct { diff --git a/listener/socks/udp.go b/listener/socks/udp.go index 2f786e95..ef31b20e 100644 --- a/listener/socks/udp.go +++ b/listener/socks/udp.go @@ -3,12 +3,12 @@ package socks import ( "net" - "github.com/Dreamacro/clash/adapter/inbound" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/sockopt" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/adapter/inbound" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/sockopt" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/transport/socks5" ) type UDPListener struct { diff --git a/listener/socks/utils.go b/listener/socks/utils.go index 3456b595..d113d45c 100644 --- a/listener/socks/utils.go +++ b/listener/socks/utils.go @@ -3,7 +3,7 @@ package socks import ( "net" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/transport/socks5" ) type packet struct { diff --git a/listener/tproxy/packet.go b/listener/tproxy/packet.go index 24fff09a..e4852665 100644 --- a/listener/tproxy/packet.go +++ b/listener/tproxy/packet.go @@ -6,10 +6,10 @@ import ( "net" "net/netip" - "github.com/Dreamacro/clash/adapter/inbound" - "github.com/Dreamacro/clash/common/pool" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/adapter/inbound" + "github.com/metacubex/mihomo/common/pool" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" ) type packet struct { diff --git a/listener/tproxy/tproxy.go b/listener/tproxy/tproxy.go index 319d5c30..efb144a9 100644 --- a/listener/tproxy/tproxy.go +++ b/listener/tproxy/tproxy.go @@ -3,10 +3,10 @@ package tproxy import ( "net" - "github.com/Dreamacro/clash/adapter/inbound" - N "github.com/Dreamacro/clash/common/net" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/adapter/inbound" + N "github.com/metacubex/mihomo/common/net" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/socks5" ) type Listener struct { diff --git a/listener/tproxy/tproxy_iptables.go b/listener/tproxy/tproxy_iptables.go index 31ac24e5..5ddd7b4c 100644 --- a/listener/tproxy/tproxy_iptables.go +++ b/listener/tproxy/tproxy_iptables.go @@ -6,9 +6,9 @@ import ( "net" "runtime" - "github.com/Dreamacro/clash/common/cmd" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/common/cmd" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/log" ) var ( @@ -48,25 +48,25 @@ func SetTProxyIPTables(ifname string, bypass []string, tport uint16, dport uint1 execCmd(fmt.Sprintf("iptables -t filter -A FORWARD -i %s -o %s -j ACCEPT", interfaceName, interfaceName)) } - // set clash divert - execCmd("iptables -t mangle -N clash_divert") - execCmd("iptables -t mangle -F clash_divert") - execCmd(fmt.Sprintf("iptables -t mangle -A clash_divert -j MARK --set-mark %s", PROXY_FWMARK)) - execCmd("iptables -t mangle -A clash_divert -j ACCEPT") + // set mihomo divert + execCmd("iptables -t mangle -N mihomo_divert") + execCmd("iptables -t mangle -F mihomo_divert") + execCmd(fmt.Sprintf("iptables -t mangle -A mihomo_divert -j MARK --set-mark %s", PROXY_FWMARK)) + execCmd("iptables -t mangle -A mihomo_divert -j ACCEPT") // set pre routing - execCmd("iptables -t mangle -N clash_prerouting") - execCmd("iptables -t mangle -F clash_prerouting") - execCmd("iptables -t mangle -A clash_prerouting -s 172.17.0.0/16 -j RETURN") - execCmd("iptables -t mangle -A clash_prerouting -p udp --dport 53 -j ACCEPT") - execCmd("iptables -t mangle -A clash_prerouting -p tcp --dport 53 -j ACCEPT") - execCmd("iptables -t mangle -A clash_prerouting -m addrtype --dst-type LOCAL -j RETURN") - addLocalnetworkToChain("clash_prerouting", bypass) - execCmd("iptables -t mangle -A clash_prerouting -p tcp -m socket -j clash_divert") - execCmd("iptables -t mangle -A clash_prerouting -p udp -m socket -j clash_divert") - execCmd(fmt.Sprintf("iptables -t mangle -A clash_prerouting -p tcp -j TPROXY --on-port %d --tproxy-mark %s/%s", tProxyPort, PROXY_FWMARK, PROXY_FWMARK)) - execCmd(fmt.Sprintf("iptables -t mangle -A clash_prerouting -p udp -j TPROXY --on-port %d --tproxy-mark %s/%s", tProxyPort, PROXY_FWMARK, PROXY_FWMARK)) - execCmd("iptables -t mangle -A PREROUTING -j clash_prerouting") + execCmd("iptables -t mangle -N mihomo_prerouting") + execCmd("iptables -t mangle -F mihomo_prerouting") + execCmd("iptables -t mangle -A mihomo_prerouting -s 172.17.0.0/16 -j RETURN") + execCmd("iptables -t mangle -A mihomo_prerouting -p udp --dport 53 -j ACCEPT") + execCmd("iptables -t mangle -A mihomo_prerouting -p tcp --dport 53 -j ACCEPT") + execCmd("iptables -t mangle -A mihomo_prerouting -m addrtype --dst-type LOCAL -j RETURN") + addLocalnetworkToChain("mihomo_prerouting", bypass) + execCmd("iptables -t mangle -A mihomo_prerouting -p tcp -m socket -j mihomo_divert") + execCmd("iptables -t mangle -A mihomo_prerouting -p udp -m socket -j mihomo_divert") + execCmd(fmt.Sprintf("iptables -t mangle -A mihomo_prerouting -p tcp -j TPROXY --on-port %d --tproxy-mark %s/%s", tProxyPort, PROXY_FWMARK, PROXY_FWMARK)) + execCmd(fmt.Sprintf("iptables -t mangle -A mihomo_prerouting -p udp -j TPROXY --on-port %d --tproxy-mark %s/%s", tProxyPort, PROXY_FWMARK, PROXY_FWMARK)) + execCmd("iptables -t mangle -A PREROUTING -j mihomo_prerouting") execCmd(fmt.Sprintf("iptables -t nat -I PREROUTING ! -s 172.17.0.0/16 ! -d 127.0.0.0/8 -p tcp --dport 53 -j REDIRECT --to %d", dnsPort)) execCmd(fmt.Sprintf("iptables -t nat -I PREROUTING ! -s 172.17.0.0/16 ! -d 127.0.0.0/8 -p udp --dport 53 -j REDIRECT --to %d", dnsPort)) @@ -77,27 +77,27 @@ func SetTProxyIPTables(ifname string, bypass []string, tport uint16, dport uint1 } // set output - execCmd("iptables -t mangle -N clash_output") - execCmd("iptables -t mangle -F clash_output") - execCmd(fmt.Sprintf("iptables -t mangle -A clash_output -m mark --mark %#x -j RETURN", dialer.DefaultRoutingMark.Load())) - execCmd("iptables -t mangle -A clash_output -p udp -m multiport --dports 53,123,137 -j ACCEPT") - execCmd("iptables -t mangle -A clash_output -p tcp --dport 53 -j ACCEPT") - execCmd("iptables -t mangle -A clash_output -m addrtype --dst-type LOCAL -j RETURN") - execCmd("iptables -t mangle -A clash_output -m addrtype --dst-type BROADCAST -j RETURN") - addLocalnetworkToChain("clash_output", bypass) - execCmd(fmt.Sprintf("iptables -t mangle -A clash_output -p tcp -j MARK --set-mark %s", PROXY_FWMARK)) - execCmd(fmt.Sprintf("iptables -t mangle -A clash_output -p udp -j MARK --set-mark %s", PROXY_FWMARK)) - execCmd(fmt.Sprintf("iptables -t mangle -I OUTPUT -o %s -j clash_output", interfaceName)) + execCmd("iptables -t mangle -N mihomo_output") + execCmd("iptables -t mangle -F mihomo_output") + execCmd(fmt.Sprintf("iptables -t mangle -A mihomo_output -m mark --mark %#x -j RETURN", dialer.DefaultRoutingMark.Load())) + execCmd("iptables -t mangle -A mihomo_output -p udp -m multiport --dports 53,123,137 -j ACCEPT") + execCmd("iptables -t mangle -A mihomo_output -p tcp --dport 53 -j ACCEPT") + execCmd("iptables -t mangle -A mihomo_output -m addrtype --dst-type LOCAL -j RETURN") + execCmd("iptables -t mangle -A mihomo_output -m addrtype --dst-type BROADCAST -j RETURN") + addLocalnetworkToChain("mihomo_output", bypass) + execCmd(fmt.Sprintf("iptables -t mangle -A mihomo_output -p tcp -j MARK --set-mark %s", PROXY_FWMARK)) + execCmd(fmt.Sprintf("iptables -t mangle -A mihomo_output -p udp -j MARK --set-mark %s", PROXY_FWMARK)) + execCmd(fmt.Sprintf("iptables -t mangle -I OUTPUT -o %s -j mihomo_output", interfaceName)) // set dns output - execCmd("iptables -t nat -N clash_dns_output") - execCmd("iptables -t nat -F clash_dns_output") - execCmd(fmt.Sprintf("iptables -t nat -A clash_dns_output -m mark --mark %#x -j RETURN", dialer.DefaultRoutingMark.Load())) - execCmd("iptables -t nat -A clash_dns_output -s 172.17.0.0/16 -j RETURN") - execCmd(fmt.Sprintf("iptables -t nat -A clash_dns_output -p udp -j REDIRECT --to-ports %d", dnsPort)) - execCmd(fmt.Sprintf("iptables -t nat -A clash_dns_output -p tcp -j REDIRECT --to-ports %d", dnsPort)) - execCmd("iptables -t nat -I OUTPUT -p tcp --dport 53 -j clash_dns_output") - execCmd("iptables -t nat -I OUTPUT -p udp --dport 53 -j clash_dns_output") + execCmd("iptables -t nat -N mihomo_dns_output") + execCmd("iptables -t nat -F mihomo_dns_output") + execCmd(fmt.Sprintf("iptables -t nat -A mihomo_dns_output -m mark --mark %#x -j RETURN", dialer.DefaultRoutingMark.Load())) + execCmd("iptables -t nat -A mihomo_dns_output -s 172.17.0.0/16 -j RETURN") + execCmd(fmt.Sprintf("iptables -t nat -A mihomo_dns_output -p udp -j REDIRECT --to-ports %d", dnsPort)) + execCmd(fmt.Sprintf("iptables -t nat -A mihomo_dns_output -p tcp -j REDIRECT --to-ports %d", dnsPort)) + execCmd("iptables -t nat -I OUTPUT -p tcp --dport 53 -j mihomo_dns_output") + execCmd("iptables -t nat -I OUTPUT -p udp --dport 53 -j mihomo_dns_output") return nil } @@ -113,7 +113,7 @@ func CleanupTProxyIPTables() { dialer.DefaultRoutingMark.Store(0) } - if _, err := cmd.ExecCmd("iptables -t mangle -L clash_divert"); err != nil { + if _, err := cmd.ExecCmd("iptables -t mangle -L mihomo_divert"); err != nil { return } @@ -132,7 +132,7 @@ func CleanupTProxyIPTables() { // clean PREROUTING execCmd(fmt.Sprintf("iptables -t nat -D PREROUTING ! -s 172.17.0.0/16 ! -d 127.0.0.0/8 -p tcp --dport 53 -j REDIRECT --to %d", dnsPort)) execCmd(fmt.Sprintf("iptables -t nat -D PREROUTING ! -s 172.17.0.0/16 ! -d 127.0.0.0/8 -p udp --dport 53 -j REDIRECT --to %d", dnsPort)) - execCmd("iptables -t mangle -D PREROUTING -j clash_prerouting") + execCmd("iptables -t mangle -D PREROUTING -j mihomo_prerouting") // clean POSTROUTING if interfaceName != "lo" { @@ -140,19 +140,19 @@ func CleanupTProxyIPTables() { } // clean OUTPUT - execCmd(fmt.Sprintf("iptables -t mangle -D OUTPUT -o %s -j clash_output", interfaceName)) - execCmd("iptables -t nat -D OUTPUT -p tcp --dport 53 -j clash_dns_output") - execCmd("iptables -t nat -D OUTPUT -p udp --dport 53 -j clash_dns_output") + execCmd(fmt.Sprintf("iptables -t mangle -D OUTPUT -o %s -j mihomo_output", interfaceName)) + execCmd("iptables -t nat -D OUTPUT -p tcp --dport 53 -j mihomo_dns_output") + execCmd("iptables -t nat -D OUTPUT -p udp --dport 53 -j mihomo_dns_output") // clean chain - execCmd("iptables -t mangle -F clash_prerouting") - execCmd("iptables -t mangle -X clash_prerouting") - execCmd("iptables -t mangle -F clash_divert") - execCmd("iptables -t mangle -X clash_divert") - execCmd("iptables -t mangle -F clash_output") - execCmd("iptables -t mangle -X clash_output") - execCmd("iptables -t nat -F clash_dns_output") - execCmd("iptables -t nat -X clash_dns_output") + execCmd("iptables -t mangle -F mihomo_prerouting") + execCmd("iptables -t mangle -X mihomo_prerouting") + execCmd("iptables -t mangle -F mihomo_divert") + execCmd("iptables -t mangle -X mihomo_divert") + execCmd("iptables -t mangle -F mihomo_output") + execCmd("iptables -t mangle -X mihomo_output") + execCmd("iptables -t nat -F mihomo_dns_output") + execCmd("iptables -t nat -X mihomo_dns_output") interfaceName = "" tProxyPort = 0 diff --git a/listener/tproxy/udp.go b/listener/tproxy/udp.go index c8460def..aa0fee19 100644 --- a/listener/tproxy/udp.go +++ b/listener/tproxy/udp.go @@ -4,10 +4,10 @@ import ( "net" "net/netip" - "github.com/Dreamacro/clash/adapter/inbound" - "github.com/Dreamacro/clash/common/pool" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/adapter/inbound" + "github.com/metacubex/mihomo/common/pool" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/socks5" ) type UDPListener struct { diff --git a/listener/tuic/server.go b/listener/tuic/server.go index 544f1328..7fa7b18e 100644 --- a/listener/tuic/server.go +++ b/listener/tuic/server.go @@ -7,15 +7,15 @@ import ( "strings" "time" - "github.com/Dreamacro/clash/adapter/inbound" - CN "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/sockopt" - C "github.com/Dreamacro/clash/constant" - LC "github.com/Dreamacro/clash/listener/config" - "github.com/Dreamacro/clash/listener/sing" - "github.com/Dreamacro/clash/log" - "github.com/Dreamacro/clash/transport/socks5" - "github.com/Dreamacro/clash/transport/tuic" + "github.com/metacubex/mihomo/adapter/inbound" + CN "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/sockopt" + C "github.com/metacubex/mihomo/constant" + LC "github.com/metacubex/mihomo/listener/config" + "github.com/metacubex/mihomo/listener/sing" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/transport/socks5" + "github.com/metacubex/mihomo/transport/tuic" "github.com/gofrs/uuid/v5" "github.com/metacubex/quic-go" diff --git a/listener/tunnel/packet.go b/listener/tunnel/packet.go index 35601e38..165004d6 100644 --- a/listener/tunnel/packet.go +++ b/listener/tunnel/packet.go @@ -3,7 +3,7 @@ package tunnel import ( "net" - "github.com/Dreamacro/clash/common/pool" + "github.com/metacubex/mihomo/common/pool" ) type packet struct { diff --git a/listener/tunnel/tcp.go b/listener/tunnel/tcp.go index 9fca14dd..794dc8ac 100644 --- a/listener/tunnel/tcp.go +++ b/listener/tunnel/tcp.go @@ -4,10 +4,10 @@ import ( "fmt" "net" - "github.com/Dreamacro/clash/adapter/inbound" - N "github.com/Dreamacro/clash/common/net" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/adapter/inbound" + N "github.com/metacubex/mihomo/common/net" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/socks5" ) type Listener struct { diff --git a/listener/tunnel/udp.go b/listener/tunnel/udp.go index 00d61663..f7d980ab 100644 --- a/listener/tunnel/udp.go +++ b/listener/tunnel/udp.go @@ -4,10 +4,10 @@ import ( "fmt" "net" - "github.com/Dreamacro/clash/adapter/inbound" - "github.com/Dreamacro/clash/common/pool" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/adapter/inbound" + "github.com/metacubex/mihomo/common/pool" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/socks5" ) type PacketConn struct { diff --git a/log/log.go b/log/log.go index acddeaff..d431dcb1 100644 --- a/log/log.go +++ b/log/log.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/Dreamacro/clash/common/observable" + "github.com/metacubex/mihomo/common/observable" log "github.com/sirupsen/logrus" ) diff --git a/main.go b/main.go index d41450b6..fd1e065c 100644 --- a/main.go +++ b/main.go @@ -3,7 +3,7 @@ package main import ( "flag" "fmt" - "github.com/Dreamacro/clash/constant/features" + "github.com/metacubex/mihomo/constant/features" "os" "os/signal" "path/filepath" @@ -11,11 +11,11 @@ import ( "strings" "syscall" - "github.com/Dreamacro/clash/config" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/hub" - "github.com/Dreamacro/clash/hub/executor" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/config" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/hub" + "github.com/metacubex/mihomo/hub/executor" + "github.com/metacubex/mihomo/log" "go.uber.org/automaxprocs/maxprocs" ) @@ -38,7 +38,7 @@ func init() { flag.StringVar(&externalController, "ext-ctl", os.Getenv("CLASH_OVERRIDE_EXTERNAL_CONTROLLER"), "override external controller address") flag.StringVar(&secret, "secret", os.Getenv("CLASH_OVERRIDE_SECRET"), "override secret for RESTful API") flag.BoolVar(&geodataMode, "m", false, "set geodata mode") - flag.BoolVar(&version, "v", false, "show current version of clash") + flag.BoolVar(&version, "v", false, "show current version of mihomo") flag.BoolVar(&testConfig, "t", false, "test configuration and exit") flag.Parse() } @@ -46,7 +46,7 @@ func init() { func main() { _, _ = maxprocs.Set(maxprocs.Logger(func(string, ...any) {})) if version { - fmt.Printf("Clash Meta %s %s %s with %s %s\n", + fmt.Printf("Mihomo Meta %s %s %s with %s %s\n", C.Version, runtime.GOOS, runtime.GOARCH, runtime.Version(), C.BuildTime) if len(features.TAGS) != 0 { fmt.Printf("Use tags: %s\n", strings.Join(features.TAGS, ", ")) diff --git a/ntp/service.go b/ntp/service.go index c5506197..4c95045a 100644 --- a/ntp/service.go +++ b/ntp/service.go @@ -5,9 +5,9 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/component/dialer" - "github.com/Dreamacro/clash/component/proxydialer" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/proxydialer" + "github.com/metacubex/mihomo/log" M "github.com/sagernet/sing/common/metadata" "github.com/sagernet/sing/common/ntp" diff --git a/rules/common/domain.go b/rules/common/domain.go index 35a06a70..23f21185 100644 --- a/rules/common/domain.go +++ b/rules/common/domain.go @@ -3,7 +3,7 @@ package common import ( "strings" - C "github.com/Dreamacro/clash/constant" + C "github.com/metacubex/mihomo/constant" ) type Domain struct { diff --git a/rules/common/domain_keyword.go b/rules/common/domain_keyword.go index d945f200..ec01293a 100644 --- a/rules/common/domain_keyword.go +++ b/rules/common/domain_keyword.go @@ -3,7 +3,7 @@ package common import ( "strings" - C "github.com/Dreamacro/clash/constant" + C "github.com/metacubex/mihomo/constant" ) type DomainKeyword struct { diff --git a/rules/common/domain_suffix.go b/rules/common/domain_suffix.go index b13036a3..b7b1794d 100644 --- a/rules/common/domain_suffix.go +++ b/rules/common/domain_suffix.go @@ -3,7 +3,7 @@ package common import ( "strings" - C "github.com/Dreamacro/clash/constant" + C "github.com/metacubex/mihomo/constant" ) type DomainSuffix struct { diff --git a/rules/common/final.go b/rules/common/final.go index 8aa5ed7b..d3a415a0 100644 --- a/rules/common/final.go +++ b/rules/common/final.go @@ -1,7 +1,7 @@ package common import ( - C "github.com/Dreamacro/clash/constant" + C "github.com/metacubex/mihomo/constant" ) type Match struct { diff --git a/rules/common/geoip.go b/rules/common/geoip.go index 2f96c2ef..3a29fae4 100644 --- a/rules/common/geoip.go +++ b/rules/common/geoip.go @@ -4,12 +4,12 @@ import ( "fmt" "strings" - "github.com/Dreamacro/clash/component/geodata" - "github.com/Dreamacro/clash/component/geodata/router" - "github.com/Dreamacro/clash/component/mmdb" - "github.com/Dreamacro/clash/component/resolver" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/component/geodata" + "github.com/metacubex/mihomo/component/geodata/router" + "github.com/metacubex/mihomo/component/mmdb" + "github.com/metacubex/mihomo/component/resolver" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" ) type GEOIP struct { diff --git a/rules/common/geosite.go b/rules/common/geosite.go index e89dc19b..e9b19d0e 100644 --- a/rules/common/geosite.go +++ b/rules/common/geosite.go @@ -3,12 +3,12 @@ package common import ( "fmt" - "github.com/Dreamacro/clash/component/geodata" - _ "github.com/Dreamacro/clash/component/geodata/memconservative" - "github.com/Dreamacro/clash/component/geodata/router" - _ "github.com/Dreamacro/clash/component/geodata/standard" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/component/geodata" + _ "github.com/metacubex/mihomo/component/geodata/memconservative" + "github.com/metacubex/mihomo/component/geodata/router" + _ "github.com/metacubex/mihomo/component/geodata/standard" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" ) type GEOSITE struct { diff --git a/rules/common/in_name.go b/rules/common/in_name.go index 1e2abe15..9b14ef6a 100644 --- a/rules/common/in_name.go +++ b/rules/common/in_name.go @@ -2,7 +2,7 @@ package common import ( "fmt" - C "github.com/Dreamacro/clash/constant" + C "github.com/metacubex/mihomo/constant" "strings" ) diff --git a/rules/common/in_type.go b/rules/common/in_type.go index 453045d8..fc73b208 100644 --- a/rules/common/in_type.go +++ b/rules/common/in_type.go @@ -2,7 +2,7 @@ package common import ( "fmt" - C "github.com/Dreamacro/clash/constant" + C "github.com/metacubex/mihomo/constant" "strings" ) diff --git a/rules/common/in_user.go b/rules/common/in_user.go index 24f4b2e5..ebe881af 100644 --- a/rules/common/in_user.go +++ b/rules/common/in_user.go @@ -2,7 +2,7 @@ package common import ( "fmt" - C "github.com/Dreamacro/clash/constant" + C "github.com/metacubex/mihomo/constant" "strings" ) diff --git a/rules/common/ipcidr.go b/rules/common/ipcidr.go index 4cdf9106..663c9397 100644 --- a/rules/common/ipcidr.go +++ b/rules/common/ipcidr.go @@ -3,7 +3,7 @@ package common import ( "net/netip" - C "github.com/Dreamacro/clash/constant" + C "github.com/metacubex/mihomo/constant" ) type IPCIDROption func(*IPCIDR) diff --git a/rules/common/ipsuffix.go b/rules/common/ipsuffix.go index b01557dc..3251faf8 100644 --- a/rules/common/ipsuffix.go +++ b/rules/common/ipsuffix.go @@ -1,7 +1,7 @@ package common import ( - C "github.com/Dreamacro/clash/constant" + C "github.com/metacubex/mihomo/constant" "net/netip" ) diff --git a/rules/common/network_type.go b/rules/common/network_type.go index 1184ba89..83a332d8 100644 --- a/rules/common/network_type.go +++ b/rules/common/network_type.go @@ -2,7 +2,7 @@ package common import ( "fmt" - C "github.com/Dreamacro/clash/constant" + C "github.com/metacubex/mihomo/constant" "strings" ) diff --git a/rules/common/port.go b/rules/common/port.go index 334d083f..ec76cf30 100644 --- a/rules/common/port.go +++ b/rules/common/port.go @@ -3,8 +3,8 @@ package common import ( "fmt" - "github.com/Dreamacro/clash/common/utils" - C "github.com/Dreamacro/clash/constant" + "github.com/metacubex/mihomo/common/utils" + C "github.com/metacubex/mihomo/constant" ) type Port struct { diff --git a/rules/common/process.go b/rules/common/process.go index e972d2bc..ce643594 100644 --- a/rules/common/process.go +++ b/rules/common/process.go @@ -3,7 +3,7 @@ package common import ( "strings" - C "github.com/Dreamacro/clash/constant" + C "github.com/metacubex/mihomo/constant" ) type Process struct { diff --git a/rules/common/uid.go b/rules/common/uid.go index 3b20928f..de46c409 100644 --- a/rules/common/uid.go +++ b/rules/common/uid.go @@ -4,9 +4,9 @@ import ( "fmt" "runtime" - "github.com/Dreamacro/clash/common/utils" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/common/utils" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" ) type Uid struct { diff --git a/rules/logic/logic.go b/rules/logic/logic.go index a53503df..4256a200 100644 --- a/rules/logic/logic.go +++ b/rules/logic/logic.go @@ -5,9 +5,9 @@ import ( "regexp" "strings" - "github.com/Dreamacro/clash/common/collections" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/rules/common" + "github.com/metacubex/mihomo/common/collections" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/rules/common" ) type Logic struct { diff --git a/rules/logic_test/logic_test.go b/rules/logic_test/logic_test.go index 52318b3f..e88c8578 100644 --- a/rules/logic_test/logic_test.go +++ b/rules/logic_test/logic_test.go @@ -2,10 +2,10 @@ package logic_test import ( // https://github.com/golang/go/wiki/CodeReviewComments#import-dot - . "github.com/Dreamacro/clash/rules/logic" + . "github.com/metacubex/mihomo/rules/logic" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/rules" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/rules" "github.com/stretchr/testify/assert" "testing" ) diff --git a/rules/parser.go b/rules/parser.go index df790bc3..b1baa758 100644 --- a/rules/parser.go +++ b/rules/parser.go @@ -2,10 +2,10 @@ package rules import ( "fmt" - C "github.com/Dreamacro/clash/constant" - RC "github.com/Dreamacro/clash/rules/common" - "github.com/Dreamacro/clash/rules/logic" - RP "github.com/Dreamacro/clash/rules/provider" + C "github.com/metacubex/mihomo/constant" + RC "github.com/metacubex/mihomo/rules/common" + "github.com/metacubex/mihomo/rules/logic" + RP "github.com/metacubex/mihomo/rules/provider" ) func ParseRule(tp, payload, target string, params []string, subRules map[string][]C.Rule) (parsed C.Rule, parseErr error) { diff --git a/rules/provider/classical_strategy.go b/rules/provider/classical_strategy.go index 6561f12f..f8042164 100644 --- a/rules/provider/classical_strategy.go +++ b/rules/provider/classical_strategy.go @@ -2,8 +2,8 @@ package provider import ( "fmt" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" "strings" ) diff --git a/rules/provider/domain_strategy.go b/rules/provider/domain_strategy.go index d686d598..c0787d58 100644 --- a/rules/provider/domain_strategy.go +++ b/rules/provider/domain_strategy.go @@ -1,9 +1,9 @@ package provider import ( - "github.com/Dreamacro/clash/component/trie" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/component/trie" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" ) type domainStrategy struct { diff --git a/rules/provider/ipcidr_strategy.go b/rules/provider/ipcidr_strategy.go index f54302f1..321e901a 100644 --- a/rules/provider/ipcidr_strategy.go +++ b/rules/provider/ipcidr_strategy.go @@ -1,9 +1,9 @@ package provider import ( - "github.com/Dreamacro/clash/component/trie" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/component/trie" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" ) type ipcidrStrategy struct { diff --git a/rules/provider/parse.go b/rules/provider/parse.go index 0fbfb2cc..3a5c4fd7 100644 --- a/rules/provider/parse.go +++ b/rules/provider/parse.go @@ -5,10 +5,10 @@ import ( "fmt" "time" - "github.com/Dreamacro/clash/common/structure" - "github.com/Dreamacro/clash/component/resource" - C "github.com/Dreamacro/clash/constant" - P "github.com/Dreamacro/clash/constant/provider" + "github.com/metacubex/mihomo/common/structure" + "github.com/metacubex/mihomo/component/resource" + C "github.com/metacubex/mihomo/constant" + P "github.com/metacubex/mihomo/constant/provider" ) var ( diff --git a/rules/provider/provider.go b/rules/provider/provider.go index 65d21d2f..adc2e44a 100644 --- a/rules/provider/provider.go +++ b/rules/provider/provider.go @@ -9,10 +9,10 @@ import ( "strings" "time" - "github.com/Dreamacro/clash/common/pool" - "github.com/Dreamacro/clash/component/resource" - C "github.com/Dreamacro/clash/constant" - P "github.com/Dreamacro/clash/constant/provider" + "github.com/metacubex/mihomo/common/pool" + "github.com/metacubex/mihomo/component/resource" + C "github.com/metacubex/mihomo/constant" + P "github.com/metacubex/mihomo/constant/provider" ) var ( diff --git a/rules/provider/rule_set.go b/rules/provider/rule_set.go index 45cddf6c..1d940188 100644 --- a/rules/provider/rule_set.go +++ b/rules/provider/rule_set.go @@ -2,9 +2,9 @@ package provider import ( "fmt" - C "github.com/Dreamacro/clash/constant" - P "github.com/Dreamacro/clash/constant/provider" - "github.com/Dreamacro/clash/rules/common" + C "github.com/metacubex/mihomo/constant" + P "github.com/metacubex/mihomo/constant/provider" + "github.com/metacubex/mihomo/rules/common" ) type RuleSet struct { diff --git a/test/.golangci.yaml b/test/.golangci.yaml index b65afc5e..e1fbbf76 100644 --- a/test/.golangci.yaml +++ b/test/.golangci.yaml @@ -10,7 +10,7 @@ linters-settings: gci: sections: - standard - - prefix(github.com/Dreamacro/clash) + - prefix(github.com/metacubex/mihomo) - default staticcheck: go: '1.19' diff --git a/test/README.md b/test/README.md index a95f3aea..e9fa5630 100644 --- a/test/README.md +++ b/test/README.md @@ -1,4 +1,4 @@ -## Clash testing suit +## Mihomo testing suit ### Protocol testing suit @@ -51,8 +51,8 @@ $ make test benchmark (Linux) > Cannot represent the throughput of the protocol on your machine -> but you can compare the corresponding throughput of the protocol on clash -> (change chunkSize to measure the maximum throughput of clash on your machine) +> but you can compare the corresponding throughput of the protocol on mihomo +> (change chunkSize to measure the maximum throughput of mihomo on your machine) ``` $ make benchmark diff --git a/test/clash_test.go b/test/clash_test.go index 60b99791..90ac9d22 100644 --- a/test/clash_test.go +++ b/test/clash_test.go @@ -16,13 +16,13 @@ import ( "testing" "time" - "github.com/Dreamacro/clash/adapter/outbound" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/hub/executor" - "github.com/Dreamacro/clash/transport/socks5" "github.com/docker/docker/api/types" "github.com/docker/docker/client" "github.com/docker/go-connections/nat" + "github.com/metacubex/mihomo/adapter/outbound" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/hub/executor" + "github.com/metacubex/mihomo/transport/socks5" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -658,7 +658,7 @@ func benchmarkProxy(b *testing.B, proxy C.ProxyAdapter) { }) } -func TestClash_Basic(t *testing.T) { +func TestMihomo_Basic(t *testing.T) { basic := ` mixed-port: 10000 log-level: silent diff --git a/test/dns_test.go b/test/dns_test.go index 8e30ba98..f45ffbe0 100644 --- a/test/dns_test.go +++ b/test/dns_test.go @@ -21,7 +21,7 @@ func exchange(address, domain string, tp uint16) ([]dns.RR, error) { return r.Answer, nil } -func TestClash_DNS(t *testing.T) { +func TestMihomo_DNS(t *testing.T) { basic := ` log-level: silent dns: @@ -49,11 +49,11 @@ dns: assert.Empty(t, rr) } -func TestClash_DNSHostAndFakeIP(t *testing.T) { +func TestMihomo_DNSHostAndFakeIP(t *testing.T) { basic := ` log-level: silent hosts: - foo.clash.dev: 1.1.1.1 + foo.mihomo.dev: 1.1.1.1 dns: enable: true listen: 0.0.0.0:8553 @@ -81,7 +81,7 @@ dns: {"foo.org", "198.18.0.4"}, {"bar.org", "198.18.0.5"}, {"foo.org", "198.18.0.4"}, - {"foo.clash.dev", "1.1.1.1"}, + {"foo.mihomo.dev", "1.1.1.1"}, } for _, pair := range list { diff --git a/test/go.mod b/test/go.mod index 36fa7256..adb42a2c 100644 --- a/test/go.mod +++ b/test/go.mod @@ -1,17 +1,17 @@ -module clash-test +module mihomo-test -go 1.19 +go 1.20 require ( - github.com/Dreamacro/clash v0.0.0 github.com/docker/docker v20.10.21+incompatible github.com/docker/go-connections v0.4.0 + github.com/metacubex/mihomo v0.0.0 github.com/miekg/dns v1.1.56 github.com/stretchr/testify v1.8.4 golang.org/x/net v0.17.0 ) -replace github.com/Dreamacro/clash => ../ +replace github.com/metacubex/mihomo => ../ require ( github.com/3andne/restls-client-go v0.1.6 // indirect @@ -30,17 +30,18 @@ require ( github.com/ericlagergren/polyval v0.0.0-20220411101811-e25bc10ba391 // indirect github.com/ericlagergren/siv v0.0.0-20220507050439-0b757b3aa5f1 // indirect github.com/ericlagergren/subtle v0.0.0-20220507045147-890d697da010 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/gaukas/godicttls v0.0.4 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect + github.com/gobwas/httphead v0.1.0 // indirect + github.com/gobwas/pool v0.2.1 // indirect + github.com/gobwas/ws v1.3.0 // indirect github.com/gofrs/uuid/v5 v5.0.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/mock v1.6.0 // indirect github.com/google/btree v1.1.2 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect - github.com/gorilla/websocket v1.5.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/insomniacslk/dhcp v0.0.0-20230908212754-65c27093e38a // indirect github.com/josharian/native v1.1.0 // indirect @@ -54,9 +55,10 @@ require ( github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759 // indirect github.com/metacubex/gvisor v0.0.0-20231001104248-0f672c3fb8d8 // indirect github.com/metacubex/quic-go v0.39.1-0.20231019030608-fd969d66f16b // indirect + github.com/metacubex/sing-quic v0.0.0-20231008050747-a684db516966 // indirect github.com/metacubex/sing-shadowsocks v0.2.5 // indirect github.com/metacubex/sing-shadowsocks2 v0.1.4 // indirect - github.com/metacubex/sing-tun v0.1.15-0.20231003075803-dffa0200e64c // indirect + github.com/metacubex/sing-tun v0.1.15-0.20231103033938-170591e8d5bd // indirect github.com/metacubex/sing-vmess v0.1.9-0.20230921005247-a0488d7dac74 // indirect github.com/metacubex/sing-wireguard v0.0.0-20231001110902-321836559170 // indirect github.com/moby/term v0.5.0 // indirect @@ -77,7 +79,7 @@ require ( github.com/quic-go/qtls-go1-20 v0.3.4 // indirect github.com/sagernet/go-tun2socks v1.16.12-0.20220818015926-16cb67876a61 // indirect github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97 // indirect - github.com/sagernet/sing v0.2.13 // indirect + github.com/sagernet/sing v0.2.14 // indirect github.com/sagernet/sing-mux v0.1.3 // indirect github.com/sagernet/sing-shadowtls v0.1.4 // indirect github.com/sagernet/smux v0.0.0-20230312102458-337ec2a5af37 // indirect @@ -100,6 +102,8 @@ require ( github.com/zhangyunhao116/fastrand v0.3.0 // indirect gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec // indirect go.etcd.io/bbolt v1.3.7 // indirect + go.uber.org/mock v0.3.0 // indirect + go4.org/netipx v0.0.0-20230824141953-6213f710f925 // indirect golang.org/x/crypto v0.14.0 // indirect golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect golang.org/x/mod v0.13.0 // indirect diff --git a/test/go.sum b/test/go.sum index 10d016c9..c7524eff 100644 --- a/test/go.sum +++ b/test/go.sum @@ -15,8 +15,7 @@ github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnweb github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cilium/ebpf v0.11.0 h1:V8gS/bTCCjX9uUnkUFUpPsksM8n1lXBAvHcpiFk1X2Y= -github.com/cilium/ebpf v0.11.0/go.mod h1:WE7CZAnqOL2RouJ4f1uyNhqr2P4CCvXFIqdRDUgWsVs= +github.com/cilium/ebpf v0.12.0 h1:oQEuIQIXgYhe1v7sYUG0P9vtJTYZLLdA6tiQmrOB1mo= github.com/cilium/ebpf v0.12.0/go.mod h1:u9H29/Iq+8cy70YqI6p5pfADkFl3vdnV2qXDg5JL0Zo= github.com/coreos/go-iptables v0.7.0 h1:XWM3V+MPRr5/q51NuWSgU0fqMad64Zyxs8ZUoMsamr8= github.com/coreos/go-iptables v0.7.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q= @@ -43,22 +42,26 @@ github.com/ericlagergren/siv v0.0.0-20220507050439-0b757b3aa5f1/go.mod h1:4Rfsap github.com/ericlagergren/subtle v0.0.0-20220507045147-890d697da010 h1:fuGucgPk5dN6wzfnxl3D0D3rVLw4v2SbBT9jb4VnxzA= github.com/ericlagergren/subtle v0.0.0-20220507045147-890d697da010/go.mod h1:JtBcj7sBuTTRupn7c2bFspMDIObMJsVK8TeUvpShPok= github.com/frankban/quicktest v1.14.5 h1:dfYrrRyLtiqT9GyKXgdh+k4inNeTvmGbuSgZ3lx3GhA= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gaukas/godicttls v0.0.4 h1:NlRaXb3J6hAnTmWdsEKb9bcSBD6BvcIjdGdeb0zfXbk= github.com/gaukas/godicttls v0.0.4/go.mod h1:l6EenT4TLWgTdwslVb4sEMOCf7Bv0JAK67deKr9/NCI= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= +github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= +github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= +github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/ws v1.3.0 h1:sbeU3Y4Qzlb+MOzIe6mQGf7QR4Hkv6ZD0qhGkBFL2O0= +github.com/gobwas/ws v1.3.0/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= github.com/gofrs/uuid/v5 v5.0.0 h1:p544++a97kEL+svbcFbCQVM9KFu0Yo25UoISXGNNH9M= github.com/gofrs/uuid/v5 v5.0.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= @@ -71,8 +74,6 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/tink/go v1.6.1 h1:t7JHqO8Ath2w2ig5vjwQYJzhGEZymedQc90lQXUBa4I= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -101,29 +102,23 @@ github.com/mdlayher/socket v0.4.1 h1:eM9y2/jlbs1M615oshPQOHZzj6R6wMT7bX5NPiQvn2U github.com/mdlayher/socket v0.4.1/go.mod h1:cAqeGjoufqdxWkD7DkpyS+wcefOtmu5OQ8KuoJGIReA= github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759 h1:cjd4biTvOzK9ubNCCkQ+ldc4YSH/rILn53l/xGBFHHI= github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759/go.mod h1:UHOv2xu+RIgLwpXca7TLrXleEd4oR3sPatW6IF8wU88= -github.com/metacubex/gvisor v0.0.0-20230611153922-78842f086475 h1:qSEOvPPaMrWggFyFhFYGyMR8i1HKyhXjdi1QYUAa2ww= -github.com/metacubex/gvisor v0.0.0-20230611153922-78842f086475/go.mod h1:wehEpqiogdeyncfhckJP5gD2LtBgJW0wnDC24mJ+8Jg= +github.com/metacubex/gvisor v0.0.0-20231001104248-0f672c3fb8d8 h1:npBvaPAT145UY8682AzpUMWpdIxJti/WPLjy7gCiYYs= github.com/metacubex/gvisor v0.0.0-20231001104248-0f672c3fb8d8/go.mod h1:ZR6Gas7P1GcADCVBc1uOrA0bLQqDDyp70+63fD/BE2c= -github.com/metacubex/quic-go v0.38.1-0.20230909013832-033f6a2115cf h1:hflzPbb2M+3uUOZEVO72MKd2R62xEermoVaNhJOzBR8= -github.com/metacubex/quic-go v0.38.1-0.20230909013832-033f6a2115cf/go.mod h1:7RCcKJJk1DMeNQQNnYKS+7FqftqPfG031oP8jrYRMw8= +github.com/metacubex/quic-go v0.39.1-0.20231019030608-fd969d66f16b h1:uZ++sW8yg7Fr/Wvmmrb/V+SfxvRs0iMC+2+u2bRmO8g= github.com/metacubex/quic-go v0.39.1-0.20231019030608-fd969d66f16b/go.mod h1:4pe6cY+nAMFU/Uxn1rfnxNIowsaJGDQ3uyy4VuiPkP4= -github.com/metacubex/sing-shadowsocks v0.2.4 h1:Gc99Z17JVif1PKKq1pjqhSmc2kvHUgk+AqxOstCzhQ0= -github.com/metacubex/sing-shadowsocks v0.2.4/go.mod h1:w9qoEZSh9aKeXSLXHe0DGbG2UE9/2VlLGwukzQZ7byI= +github.com/metacubex/sing-quic v0.0.0-20231008050747-a684db516966 h1:wbOsbU3kfD5LRuJIntJwEPmgGSQukof8CgLNypi8az8= +github.com/metacubex/sing-quic v0.0.0-20231008050747-a684db516966/go.mod h1:GU7g2AZesXItk4CspDP8Dc7eGtlA2GVDihyCwsUXRSo= +github.com/metacubex/sing-shadowsocks v0.2.5 h1:O2RRSHlKGEpAVG/OHJQxyHqDy8uvvdCW/oW2TDBOIhc= github.com/metacubex/sing-shadowsocks v0.2.5/go.mod h1:Xz2uW9BEYGEoA8B4XEpoxt7ERHClFCwsMAvWaruoyMo= -github.com/metacubex/sing-shadowsocks2 v0.1.3 h1:nZvH+4jQXZ92NeNdR9fXaUGTPNJPt6u0nkcuh/NEt5Y= -github.com/metacubex/sing-shadowsocks2 v0.1.3/go.mod h1:5Mt93RlmRlIcDmvtapkhQJ8YTRGLFhHciLYopJjs7j8= +github.com/metacubex/sing-shadowsocks2 v0.1.4 h1:OOCf8lgsVcpTOJUeaFAMzyKVebaQOBnKirDdUdBoKIE= github.com/metacubex/sing-shadowsocks2 v0.1.4/go.mod h1:Qz028sLfdY3qxGRm9FDI+IM2Ae3ty2wR7HIzD/56h/k= -github.com/metacubex/sing-tun v0.1.11 h1:B8meDewklvKkeUfjqR2ViuYLam0/m4IgkTi3qcJIOuc= -github.com/metacubex/sing-tun v0.1.11/go.mod h1:vbki176Y5sxXC1DWXucrPh3q5j8cKai1D87y8m8rjQc= -github.com/metacubex/sing-tun v0.1.15-0.20231003075803-dffa0200e64c/go.mod h1:vwmlad7eS1E+Hdv6ux0muC1FCM4UF23FHOMlrDtVARU= -github.com/metacubex/sing-vmess v0.1.8-0.20230801054944-603005461ff8 h1:AqqZCr9gOeKdO6oIzFh4b2puOUFcw8MdpmGHWRehyX8= -github.com/metacubex/sing-vmess v0.1.8-0.20230801054944-603005461ff8/go.mod h1:tyJg7b4s8NrSztl/Y1ajA7X0sJLlIsEJWkgRVocjmgY= +github.com/metacubex/sing-tun v0.1.15-0.20231103033938-170591e8d5bd h1:k0+92eARqyTAovGhg2AxdsMWHjUsdiGCnR5NuXF3CQY= +github.com/metacubex/sing-tun v0.1.15-0.20231103033938-170591e8d5bd/go.mod h1:Q7zmpJ+qOvMMXyUoYlxGQuWkqALUpXzFSSqO+KLPyzA= +github.com/metacubex/sing-vmess v0.1.9-0.20230921005247-a0488d7dac74 h1:FtupiyFkaVjFvRa7B/uDtRWg5BNsoyPC9MTev3sDasY= github.com/metacubex/sing-vmess v0.1.9-0.20230921005247-a0488d7dac74/go.mod h1:8EWBZpc+qNvf5gmvjAtMHK1/DpcWqzfcBL842K00BsM= -github.com/metacubex/sing-wireguard v0.0.0-20230611155257-1498ae315a28 h1:mXFpxfR/1nADh+GoT8maWEvc6LO6uatPsARD8WzUDMA= -github.com/metacubex/sing-wireguard v0.0.0-20230611155257-1498ae315a28/go.mod h1:KrDPq/dE793jGIJw9kcIvjA/proAfU0IeU7WlMXW7rs= +github.com/metacubex/sing-wireguard v0.0.0-20231001110902-321836559170 h1:DBGA0hmrP4pVIwLiXUONdphjcppED+plmVaKf1oqkwk= github.com/metacubex/sing-wireguard v0.0.0-20231001110902-321836559170/go.mod h1:/VbJfbdLnANE+SKXyMk/96sTRrD4GdFLh5mkegqqFcY= -github.com/miekg/dns v1.1.55 h1:GoQ4hpsj0nFLYe+bWiCToyrBEJXkQfOOIvFGFy0lEgo= -github.com/miekg/dns v1.1.55/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY= +github.com/miekg/dns v1.1.56 h1:5imZaSeoRNvpM9SzWNhEcP9QliKiz20/dA2QabIGVnE= github.com/miekg/dns v1.1.56/go.mod h1:cRm6Oo2C8TY9ZS/TqsSrseAcncm74lfK5G+ikN2SWWY= github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= @@ -155,13 +150,11 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/puzpuzpuz/xsync/v2 v2.5.0 h1:2k4qrO/orvmEXZ3hmtHqIy9XaQtPTwzMZk1+iErpE8c= -github.com/puzpuzpuz/xsync/v2 v2.5.0/go.mod h1:gD2H2krq/w52MfPLE+Uy64TzJDVY7lP2znR9qmR35kU= +github.com/puzpuzpuz/xsync/v2 v2.5.1 h1:mVGYAvzDSu52+zaGyNjC+24Xw2bQi3kTr4QJ6N9pIIU= github.com/puzpuzpuz/xsync/v2 v2.5.1/go.mod h1:gD2H2krq/w52MfPLE+Uy64TzJDVY7lP2znR9qmR35kU= github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= -github.com/quic-go/qtls-go1-20 v0.3.3 h1:17/glZSLI9P9fDAeyCHBFSWSqJcwx1byhLwP5eUIDCM= -github.com/quic-go/qtls-go1-20 v0.3.3/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k= +github.com/quic-go/qtls-go1-20 v0.3.4 h1:MfFAPULvst4yoMgY9QmtpYmfij/em7O8UUi+bNVm7Cg= github.com/quic-go/qtls-go1-20 v0.3.4/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/sagernet/go-tun2socks v1.16.12-0.20220818015926-16cb67876a61 h1:5+m7c6AkmAylhauulqN/c5dnh8/KssrE9c93TQrXldA= @@ -170,11 +163,9 @@ github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97 h1:iL5gZI3uFp0X6E github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97/go.mod h1:xLnfdiJbSp8rNqYEdIW/6eDO4mVoogml14Bh2hSiFpM= github.com/sagernet/sing v0.0.0-20220817130738-ce854cda8522/go.mod h1:QVsS5L/ZA2Q5UhQwLrn0Trw+msNd/NPGEhBKR/ioWiY= github.com/sagernet/sing v0.1.8/go.mod h1:jt1w2u7lJQFFSGLiRrRIs5YWmx4kAPfWuOejuDW9qMk= -github.com/sagernet/sing v0.2.10-0.20230807080248-4db0062caa0a h1:b89t6Mjgk4rJ5lrNMnCzy1/J116XkhgdB3YNd9FHyF4= -github.com/sagernet/sing v0.2.10-0.20230807080248-4db0062caa0a/go.mod h1:9uOZwWkhT2Z2WldolLxX34s+1svAX4i4vvz5hy8u1MA= -github.com/sagernet/sing v0.2.13/go.mod h1:AhNEHu0GXrpqkuzvTwvC8+j2cQUU/dh+zLEmq4C99pg= -github.com/sagernet/sing-mux v0.1.3-0.20230811111955-dc1639b5204c h1:35/FowAvt3Z62mck0TXzVc4jS5R5CWq62qcV2P1cp0I= -github.com/sagernet/sing-mux v0.1.3-0.20230811111955-dc1639b5204c/go.mod h1:TKxqIvfQQgd36jp2tzsPavGjYTVZilV+atip1cssjIY= +github.com/sagernet/sing v0.2.14 h1:L3AXDh22nsOOYz2nTRU1JvpRsmzViWKI1B8TsQYG1eY= +github.com/sagernet/sing v0.2.14/go.mod h1:AhNEHu0GXrpqkuzvTwvC8+j2cQUU/dh+zLEmq4C99pg= +github.com/sagernet/sing-mux v0.1.3 h1:fAf7PZa2A55mCeh0KKM02f1k2Y4vEmxuZZ/51ahkkLA= github.com/sagernet/sing-mux v0.1.3/go.mod h1:wGeIeiiFLx4HUM5LAg65wrNZ/X1muOimqK0PEhNbPi0= github.com/sagernet/sing-shadowtls v0.1.4 h1:aTgBSJEgnumzFenPvc+kbD9/W0PywzWevnVpEx6Tw3k= github.com/sagernet/sing-shadowtls v0.1.4/go.mod h1:F8NBgsY5YN2beQavdgdm1DPlhaKQlaL6lpDdcBglGK4= @@ -190,8 +181,7 @@ github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM= github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA= github.com/scjalliance/comshim v0.0.0-20230315213746-5e51f40bd3b9 h1:rc/CcqLH3lh8n+csdOuDfP+NuykE0U6AeYSJJHKDgSg= github.com/scjalliance/comshim v0.0.0-20230315213746-5e51f40bd3b9/go.mod h1:a/83NAfUXvEuLpmxDssAXxgUgrEy12MId3Wd7OTs76s= -github.com/shirou/gopsutil/v3 v3.23.8 h1:xnATPiybo6GgdRoC4YoGnxXZFRc3dqQTGi73oLvvBrE= -github.com/shirou/gopsutil/v3 v3.23.8/go.mod h1:7hmCaBn+2ZwaZOr6jmPBZDfawwMGuo1id3C6aM8EDqQ= +github.com/shirou/gopsutil/v3 v3.23.9 h1:ZI5bWVeu2ep4/DIxB4U9okeYJ7zp/QLTO4auRb/ty/E= github.com/shirou/gopsutil/v3 v3.23.9/go.mod h1:x/NWSb71eMcjFIO0vhyGW5nZ7oSIgVjrCnADckb85GA= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= @@ -228,7 +218,6 @@ github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 h1:gga7acRE695AP github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zhangyunhao116/fastrand v0.3.0 h1:7bwe124xcckPulX6fxtr2lFdO2KQqaefdtbk+mqO/Ig= @@ -237,37 +226,33 @@ gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec h1:FpfFs4EhNehiV gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec/go.mod h1:BZ1RAoRPbCxum9Grlv5aeksu2H8BiKehBYooU2LFiOQ= go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo= +go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= +go4.org/netipx v0.0.0-20230824141953-6213f710f925 h1:eeQDDVKFkx0g4Hyy8pHgmZaK0EqB4SD6rvKbUdN3ziQ= +go4.org/netipx v0.0.0-20230824141953-6213f710f925/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= -golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -277,22 +262,18 @@ golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220731174439-a90be440212d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= @@ -304,9 +285,7 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/test/hysteria_test.go b/test/hysteria_test.go index ae638e62..e783d9c2 100644 --- a/test/hysteria_test.go +++ b/test/hysteria_test.go @@ -5,13 +5,13 @@ import ( "testing" "time" - "github.com/Dreamacro/clash/adapter/outbound" - C "github.com/Dreamacro/clash/constant" "github.com/docker/docker/api/types/container" + "github.com/metacubex/mihomo/adapter/outbound" + C "github.com/metacubex/mihomo/constant" "github.com/stretchr/testify/assert" ) -func TestClash_Hysteria(t *testing.T) { +func TestMihomo_Hysteria(t *testing.T) { cfg := &container.Config{ Image: ImageHysteria, ExposedPorts: defaultExposedPorts, diff --git a/test/snell_test.go b/test/snell_test.go index ae9ce0c1..311ca7b7 100644 --- a/test/snell_test.go +++ b/test/snell_test.go @@ -5,13 +5,13 @@ import ( "testing" "time" - "github.com/Dreamacro/clash/adapter/outbound" - C "github.com/Dreamacro/clash/constant" "github.com/docker/docker/api/types/container" + "github.com/metacubex/mihomo/adapter/outbound" + C "github.com/metacubex/mihomo/constant" "github.com/stretchr/testify/require" ) -func TestClash_SnellObfsHTTP(t *testing.T) { +func TestMihomo_SnellObfsHTTP(t *testing.T) { cfg := &container.Config{ Image: ImageSnell, ExposedPorts: defaultExposedPorts, @@ -44,7 +44,7 @@ func TestClash_SnellObfsHTTP(t *testing.T) { testSuit(t, proxy) } -func TestClash_SnellObfsTLS(t *testing.T) { +func TestMihomo_SnellObfsTLS(t *testing.T) { cfg := &container.Config{ Image: ImageSnell, ExposedPorts: defaultExposedPorts, @@ -77,7 +77,7 @@ func TestClash_SnellObfsTLS(t *testing.T) { testSuit(t, proxy) } -func TestClash_Snell(t *testing.T) { +func TestMihomo_Snell(t *testing.T) { cfg := &container.Config{ Image: ImageSnell, ExposedPorts: defaultExposedPorts, @@ -107,7 +107,7 @@ func TestClash_Snell(t *testing.T) { testSuit(t, proxy) } -func TestClash_Snellv3(t *testing.T) { +func TestMihomo_Snellv3(t *testing.T) { cfg := &container.Config{ Image: ImageSnell, ExposedPorts: defaultExposedPorts, diff --git a/test/ss_test.go b/test/ss_test.go index bec1734b..866fe3a8 100644 --- a/test/ss_test.go +++ b/test/ss_test.go @@ -8,13 +8,13 @@ import ( "testing" "time" - "github.com/Dreamacro/clash/adapter/outbound" - C "github.com/Dreamacro/clash/constant" "github.com/docker/docker/api/types/container" + "github.com/metacubex/mihomo/adapter/outbound" + C "github.com/metacubex/mihomo/constant" "github.com/stretchr/testify/require" ) -func TestClash_Shadowsocks(t *testing.T) { +func TestMihomo_Shadowsocks(t *testing.T) { for _, method := range []string{ "aes-128-ctr", "aes-192-ctr", @@ -30,7 +30,7 @@ func TestClash_Shadowsocks(t *testing.T) { "xchacha20-ietf-poly1305", } { t.Run(method, func(t *testing.T) { - testClash_Shadowsocks(t, method, "FzcLbKs2dY9mhL") + testMihomo_Shadowsocks(t, method, "FzcLbKs2dY9mhL") }) } for _, method := range []string{ @@ -39,17 +39,17 @@ func TestClash_Shadowsocks(t *testing.T) { "chacha20-ietf-poly1305", } { t.Run(method, func(t *testing.T) { - testClash_ShadowsocksRust(t, method, "FzcLbKs2dY9mhL") + testMihomo_ShadowsocksRust(t, method, "FzcLbKs2dY9mhL") }) } } -func TestClash_Shadowsocks2022(t *testing.T) { +func TestMihomo_Shadowsocks2022(t *testing.T) { for _, method := range []string{ "2022-blake3-aes-128-gcm", } { t.Run(method, func(t *testing.T) { - testClash_ShadowsocksRust(t, method, mkKey(16)) + testMihomo_ShadowsocksRust(t, method, mkKey(16)) }) } for _, method := range []string{ @@ -57,7 +57,7 @@ func TestClash_Shadowsocks2022(t *testing.T) { "2022-blake3-chacha20-poly1305", } { t.Run(method, func(t *testing.T) { - testClash_ShadowsocksRust(t, method, mkKey(32)) + testMihomo_ShadowsocksRust(t, method, mkKey(32)) }) } } @@ -68,7 +68,7 @@ func mkKey(bits int) string { return base64.StdEncoding.EncodeToString(k) } -func testClash_Shadowsocks(t *testing.T, method string, password string) { +func testMihomo_Shadowsocks(t *testing.T, method string, password string) { cfg := &container.Config{ Image: ImageShadowsocks, Env: []string{ @@ -102,7 +102,7 @@ func testClash_Shadowsocks(t *testing.T, method string, password string) { testSuit(t, proxy) } -func testClash_ShadowsocksRust(t *testing.T, method string, password string) { +func testMihomo_ShadowsocksRust(t *testing.T, method string, password string) { cfg := &container.Config{ Image: ImageShadowsocksRust, Entrypoint: []string{"ssserver"}, @@ -134,7 +134,7 @@ func testClash_ShadowsocksRust(t *testing.T, method string, password string) { testSuit(t, proxy) } -func TestClash_ShadowsocksObfsHTTP(t *testing.T) { +func TestMihomo_ShadowsocksObfsHTTP(t *testing.T) { cfg := &container.Config{ Image: ImageShadowsocks, Env: []string{ @@ -172,7 +172,7 @@ func TestClash_ShadowsocksObfsHTTP(t *testing.T) { testSuit(t, proxy) } -func TestClash_ShadowsocksObfsTLS(t *testing.T) { +func TestMihomo_ShadowsocksObfsTLS(t *testing.T) { cfg := &container.Config{ Image: ImageShadowsocks, Env: []string{ @@ -210,7 +210,7 @@ func TestClash_ShadowsocksObfsTLS(t *testing.T) { testSuit(t, proxy) } -func TestClash_ShadowsocksV2RayPlugin(t *testing.T) { +func TestMihomo_ShadowsocksV2RayPlugin(t *testing.T) { cfg := &container.Config{ Image: ImageShadowsocks, Env: []string{ @@ -280,7 +280,7 @@ func Benchmark_Shadowsocks(b *testing.B) { benchmarkProxy(b, proxy) } -func TestClash_ShadowsocksUoT(t *testing.T) { +func TestMihomo_ShadowsocksUoT(t *testing.T) { configPath := C.Path.Resolve("xray-shadowsocks.json") cfg := &container.Config{ diff --git a/test/trojan_test.go b/test/trojan_test.go index 4885fd3b..c6b1fea0 100644 --- a/test/trojan_test.go +++ b/test/trojan_test.go @@ -6,13 +6,13 @@ import ( "testing" "time" - "github.com/Dreamacro/clash/adapter/outbound" - C "github.com/Dreamacro/clash/constant" "github.com/docker/docker/api/types/container" + "github.com/metacubex/mihomo/adapter/outbound" + C "github.com/metacubex/mihomo/constant" "github.com/stretchr/testify/require" ) -func TestClash_Trojan(t *testing.T) { +func TestMihomo_Trojan(t *testing.T) { cfg := &container.Config{ Image: ImageTrojan, ExposedPorts: defaultExposedPorts, @@ -48,7 +48,7 @@ func TestClash_Trojan(t *testing.T) { testSuit(t, proxy) } -func TestClash_TrojanGrpc(t *testing.T) { +func TestMihomo_TrojanGrpc(t *testing.T) { cfg := &container.Config{ Image: ImageXray, ExposedPorts: defaultExposedPorts, @@ -87,7 +87,7 @@ func TestClash_TrojanGrpc(t *testing.T) { testSuit(t, proxy) } -func TestClash_TrojanWebsocket(t *testing.T) { +func TestMihomo_TrojanWebsocket(t *testing.T) { cfg := &container.Config{ Image: ImageTrojanGo, ExposedPorts: defaultExposedPorts, @@ -123,7 +123,7 @@ func TestClash_TrojanWebsocket(t *testing.T) { testSuit(t, proxy) } -func TestClash_TrojanXTLS(t *testing.T) { +func TestMihomo_TrojanXTLS(t *testing.T) { cfg := &container.Config{ Image: ImageXray, ExposedPorts: defaultExposedPorts, diff --git a/test/vless_test.go b/test/vless_test.go index b75fb3ad..d0e6f071 100644 --- a/test/vless_test.go +++ b/test/vless_test.go @@ -5,14 +5,14 @@ import ( "testing" "time" - "github.com/Dreamacro/clash/adapter/outbound" - C "github.com/Dreamacro/clash/constant" "github.com/docker/docker/api/types/container" + "github.com/metacubex/mihomo/adapter/outbound" + C "github.com/metacubex/mihomo/constant" "github.com/stretchr/testify/assert" ) // TODO: fix udp test -func TestClash_VlessTLS(t *testing.T) { +func TestMihomo_VlessTLS(t *testing.T) { cfg := &container.Config{ Image: ImageVmess, ExposedPorts: defaultExposedPorts, @@ -51,7 +51,7 @@ func TestClash_VlessTLS(t *testing.T) { } // TODO: fix udp test -func TestClash_VlessXTLS(t *testing.T) { +func TestMihomo_VlessXTLS(t *testing.T) { cfg := &container.Config{ Image: ImageXray, ExposedPorts: defaultExposedPorts, @@ -81,7 +81,6 @@ func TestClash_VlessXTLS(t *testing.T) { ServerName: "example.org", UDP: true, Flow: "xtls-rprx-direct", - FlowShow: true, }) if err != nil { assert.FailNow(t, err.Error()) @@ -92,7 +91,7 @@ func TestClash_VlessXTLS(t *testing.T) { } // TODO: fix udp test -func TestClash_VlessWS(t *testing.T) { +func TestMihomo_VlessWS(t *testing.T) { cfg := &container.Config{ Image: ImageVmess, ExposedPorts: defaultExposedPorts, diff --git a/test/vmess_test.go b/test/vmess_test.go index fd83fff8..80c3d4d8 100644 --- a/test/vmess_test.go +++ b/test/vmess_test.go @@ -5,13 +5,13 @@ import ( "testing" "time" - "github.com/Dreamacro/clash/adapter/outbound" - C "github.com/Dreamacro/clash/constant" "github.com/docker/docker/api/types/container" + "github.com/metacubex/mihomo/adapter/outbound" + C "github.com/metacubex/mihomo/constant" "github.com/stretchr/testify/require" ) -func TestClash_Vmess(t *testing.T) { +func TestMihomo_Vmess(t *testing.T) { configPath := C.Path.Resolve("vmess.json") cfg := &container.Config{ @@ -44,7 +44,7 @@ func TestClash_Vmess(t *testing.T) { testSuit(t, proxy) } -func TestClash_VmessAuthenticatedLength(t *testing.T) { +func TestMihomo_VmessAuthenticatedLength(t *testing.T) { configPath := C.Path.Resolve("vmess.json") cfg := &container.Config{ @@ -78,7 +78,7 @@ func TestClash_VmessAuthenticatedLength(t *testing.T) { testSuit(t, proxy) } -func TestClash_VmessPacketAddr(t *testing.T) { +func TestMihomo_VmessPacketAddr(t *testing.T) { configPath := C.Path.Resolve("vmess.json") cfg := &container.Config{ @@ -112,7 +112,7 @@ func TestClash_VmessPacketAddr(t *testing.T) { testSuit(t, proxy) } -func TestClash_VmessTLS(t *testing.T) { +func TestMihomo_VmessTLS(t *testing.T) { cfg := &container.Config{ Image: ImageVmess, ExposedPorts: defaultExposedPorts, @@ -149,7 +149,7 @@ func TestClash_VmessTLS(t *testing.T) { testSuit(t, proxy) } -func TestClash_VmessHTTP2(t *testing.T) { +func TestMihomo_VmessHTTP2(t *testing.T) { cfg := &container.Config{ Image: ImageVmess, ExposedPorts: defaultExposedPorts, @@ -191,7 +191,7 @@ func TestClash_VmessHTTP2(t *testing.T) { testSuit(t, proxy) } -func TestClash_VmessHTTP(t *testing.T) { +func TestMihomo_VmessHTTP(t *testing.T) { cfg := &container.Config{ Image: ImageVmess, ExposedPorts: defaultExposedPorts, @@ -241,7 +241,7 @@ func TestClash_VmessHTTP(t *testing.T) { testSuit(t, proxy) } -func TestClash_VmessWebsocket(t *testing.T) { +func TestMihomo_VmessWebsocket(t *testing.T) { cfg := &container.Config{ Image: ImageVmess, ExposedPorts: defaultExposedPorts, @@ -274,7 +274,7 @@ func TestClash_VmessWebsocket(t *testing.T) { testSuit(t, proxy) } -func TestClash_VmessWebsocketTLS(t *testing.T) { +func TestMihomo_VmessWebsocketTLS(t *testing.T) { cfg := &container.Config{ Image: ImageVmess, ExposedPorts: defaultExposedPorts, @@ -311,7 +311,7 @@ func TestClash_VmessWebsocketTLS(t *testing.T) { testSuit(t, proxy) } -func TestClash_VmessGrpc(t *testing.T) { +func TestMihomo_VmessGrpc(t *testing.T) { cfg := &container.Config{ Image: ImageVmess, ExposedPorts: defaultExposedPorts, @@ -352,7 +352,7 @@ func TestClash_VmessGrpc(t *testing.T) { testSuit(t, proxy) } -func TestClash_VmessWebsocket0RTT(t *testing.T) { +func TestMihomo_VmessWebsocket0RTT(t *testing.T) { cfg := &container.Config{ Image: ImageVmess, ExposedPorts: defaultExposedPorts, @@ -390,7 +390,7 @@ func TestClash_VmessWebsocket0RTT(t *testing.T) { testSuit(t, proxy) } -func TestClash_VmessWebsocketXray0RTT(t *testing.T) { +func TestMihomo_VmessWebsocketXray0RTT(t *testing.T) { cfg := &container.Config{ Image: ImageXray, ExposedPorts: defaultExposedPorts, diff --git a/transport/gun/gun.go b/transport/gun/gun.go index d6ef6317..cf986c8e 100644 --- a/transport/gun/gun.go +++ b/transport/gun/gun.go @@ -17,10 +17,10 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/common/atomic" - "github.com/Dreamacro/clash/common/buf" - "github.com/Dreamacro/clash/common/pool" - tlsC "github.com/Dreamacro/clash/component/tls" + "github.com/metacubex/mihomo/common/atomic" + "github.com/metacubex/mihomo/common/buf" + "github.com/metacubex/mihomo/common/pool" + tlsC "github.com/metacubex/mihomo/component/tls" "golang.org/x/net/http2" ) diff --git a/transport/hysteria/conns/faketcp/obfs.go b/transport/hysteria/conns/faketcp/obfs.go index 35f7d013..cf58e569 100644 --- a/transport/hysteria/conns/faketcp/obfs.go +++ b/transport/hysteria/conns/faketcp/obfs.go @@ -1,7 +1,7 @@ package faketcp import ( - "github.com/Dreamacro/clash/transport/hysteria/obfs" + "github.com/metacubex/mihomo/transport/hysteria/obfs" "net" "sync" "syscall" diff --git a/transport/hysteria/conns/faketcp/tcp_linux.go b/transport/hysteria/conns/faketcp/tcp_linux.go index 76ed0d5e..2aaaf139 100644 --- a/transport/hysteria/conns/faketcp/tcp_linux.go +++ b/transport/hysteria/conns/faketcp/tcp_linux.go @@ -20,7 +20,7 @@ import ( "github.com/metacubex/gopacket" "github.com/metacubex/gopacket/layers" - "github.com/Dreamacro/clash/component/dialer" + "github.com/metacubex/mihomo/component/dialer" ) var ( diff --git a/transport/hysteria/conns/udp/hop.go b/transport/hysteria/conns/udp/hop.go index 447a7592..eb0732f0 100644 --- a/transport/hysteria/conns/udp/hop.go +++ b/transport/hysteria/conns/udp/hop.go @@ -9,8 +9,8 @@ import ( "syscall" "time" - "github.com/Dreamacro/clash/transport/hysteria/obfs" - "github.com/Dreamacro/clash/transport/hysteria/utils" + "github.com/metacubex/mihomo/transport/hysteria/obfs" + "github.com/metacubex/mihomo/transport/hysteria/utils" "github.com/zhangyunhao116/fastrand" ) diff --git a/transport/hysteria/conns/udp/obfs.go b/transport/hysteria/conns/udp/obfs.go index d63034b5..a5c6c06c 100644 --- a/transport/hysteria/conns/udp/obfs.go +++ b/transport/hysteria/conns/udp/obfs.go @@ -1,7 +1,7 @@ package udp import ( - "github.com/Dreamacro/clash/transport/hysteria/obfs" + "github.com/metacubex/mihomo/transport/hysteria/obfs" "net" "sync" "time" diff --git a/transport/hysteria/conns/wechat/obfs.go b/transport/hysteria/conns/wechat/obfs.go index d13cca55..4266d268 100644 --- a/transport/hysteria/conns/wechat/obfs.go +++ b/transport/hysteria/conns/wechat/obfs.go @@ -6,8 +6,8 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/log" - "github.com/Dreamacro/clash/transport/hysteria/obfs" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/transport/hysteria/obfs" "github.com/zhangyunhao116/fastrand" ) diff --git a/transport/hysteria/core/client.go b/transport/hysteria/core/client.go index ecc8a6f1..b556c70d 100644 --- a/transport/hysteria/core/client.go +++ b/transport/hysteria/core/client.go @@ -11,10 +11,10 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/transport/hysteria/obfs" - "github.com/Dreamacro/clash/transport/hysteria/pmtud_fix" - "github.com/Dreamacro/clash/transport/hysteria/transport" - "github.com/Dreamacro/clash/transport/hysteria/utils" + "github.com/metacubex/mihomo/transport/hysteria/obfs" + "github.com/metacubex/mihomo/transport/hysteria/pmtud_fix" + "github.com/metacubex/mihomo/transport/hysteria/transport" + "github.com/metacubex/mihomo/transport/hysteria/utils" "github.com/lunixbochs/struc" "github.com/metacubex/quic-go" diff --git a/transport/hysteria/transport/client.go b/transport/hysteria/transport/client.go index 67568bc8..f5cc9f07 100644 --- a/transport/hysteria/transport/client.go +++ b/transport/hysteria/transport/client.go @@ -9,11 +9,11 @@ import ( "github.com/metacubex/quic-go" - "github.com/Dreamacro/clash/transport/hysteria/conns/faketcp" - "github.com/Dreamacro/clash/transport/hysteria/conns/udp" - "github.com/Dreamacro/clash/transport/hysteria/conns/wechat" - obfsPkg "github.com/Dreamacro/clash/transport/hysteria/obfs" - "github.com/Dreamacro/clash/transport/hysteria/utils" + "github.com/metacubex/mihomo/transport/hysteria/conns/faketcp" + "github.com/metacubex/mihomo/transport/hysteria/conns/udp" + "github.com/metacubex/mihomo/transport/hysteria/conns/wechat" + obfsPkg "github.com/metacubex/mihomo/transport/hysteria/obfs" + "github.com/metacubex/mihomo/transport/hysteria/utils" ) type ClientTransport struct { diff --git a/transport/shadowsocks/core/cipher.go b/transport/shadowsocks/core/cipher.go index cd30360c..44b2e8d4 100644 --- a/transport/shadowsocks/core/cipher.go +++ b/transport/shadowsocks/core/cipher.go @@ -7,9 +7,9 @@ import ( "sort" "strings" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/transport/shadowsocks/shadowaead" - "github.com/Dreamacro/clash/transport/shadowsocks/shadowstream" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/transport/shadowsocks/shadowaead" + "github.com/metacubex/mihomo/transport/shadowsocks/shadowstream" ) type Cipher interface { diff --git a/transport/shadowsocks/shadowaead/packet.go b/transport/shadowsocks/shadowaead/packet.go index e84ac570..f9d21ec7 100644 --- a/transport/shadowsocks/shadowaead/packet.go +++ b/transport/shadowsocks/shadowaead/packet.go @@ -6,8 +6,8 @@ import ( "io" "net" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/pool" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/pool" ) // ErrShortPacket means that the packet is too short for a valid encrypted packet. diff --git a/transport/shadowsocks/shadowaead/stream.go b/transport/shadowsocks/shadowaead/stream.go index e92bddab..de0993b2 100644 --- a/transport/shadowsocks/shadowaead/stream.go +++ b/transport/shadowsocks/shadowaead/stream.go @@ -7,7 +7,7 @@ import ( "io" "net" - "github.com/Dreamacro/clash/common/pool" + "github.com/metacubex/mihomo/common/pool" ) const ( diff --git a/transport/shadowsocks/shadowstream/packet.go b/transport/shadowsocks/shadowstream/packet.go index f0bf43ef..39d09a70 100644 --- a/transport/shadowsocks/shadowstream/packet.go +++ b/transport/shadowsocks/shadowstream/packet.go @@ -6,8 +6,8 @@ import ( "io" "net" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/pool" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/pool" ) // ErrShortPacket means the packet is too short to be a valid encrypted packet. diff --git a/transport/shadowtls/shadowtls.go b/transport/shadowtls/shadowtls.go index 2c0c5946..a0a3d7fb 100644 --- a/transport/shadowtls/shadowtls.go +++ b/transport/shadowtls/shadowtls.go @@ -11,8 +11,8 @@ import ( "io" "net" - "github.com/Dreamacro/clash/common/pool" - C "github.com/Dreamacro/clash/constant" + "github.com/metacubex/mihomo/common/pool" + C "github.com/metacubex/mihomo/constant" ) const ( diff --git a/transport/simple-obfs/http.go b/transport/simple-obfs/http.go index 80db34ba..681c1864 100644 --- a/transport/simple-obfs/http.go +++ b/transport/simple-obfs/http.go @@ -8,7 +8,7 @@ import ( "net" "net/http" - "github.com/Dreamacro/clash/common/pool" + "github.com/metacubex/mihomo/common/pool" "github.com/zhangyunhao116/fastrand" ) diff --git a/transport/simple-obfs/tls.go b/transport/simple-obfs/tls.go index 20166bbe..78317f0a 100644 --- a/transport/simple-obfs/tls.go +++ b/transport/simple-obfs/tls.go @@ -7,7 +7,7 @@ import ( "net" "time" - "github.com/Dreamacro/clash/common/pool" + "github.com/metacubex/mihomo/common/pool" "github.com/zhangyunhao116/fastrand" ) diff --git a/transport/sing-shadowtls/shadowtls.go b/transport/sing-shadowtls/shadowtls.go index 6d731ae6..982d847a 100644 --- a/transport/sing-shadowtls/shadowtls.go +++ b/transport/sing-shadowtls/shadowtls.go @@ -5,9 +5,9 @@ import ( "crypto/tls" "net" - "github.com/Dreamacro/clash/component/ca" - tlsC "github.com/Dreamacro/clash/component/tls" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/component/ca" + tlsC "github.com/metacubex/mihomo/component/tls" + "github.com/metacubex/mihomo/log" "github.com/sagernet/sing-shadowtls" sing_common "github.com/sagernet/sing/common" diff --git a/transport/snell/cipher.go b/transport/snell/cipher.go index 24999e28..e18ce510 100644 --- a/transport/snell/cipher.go +++ b/transport/snell/cipher.go @@ -4,7 +4,7 @@ import ( "crypto/aes" "crypto/cipher" - "github.com/Dreamacro/clash/transport/shadowsocks/shadowaead" + "github.com/metacubex/mihomo/transport/shadowsocks/shadowaead" "golang.org/x/crypto/argon2" "golang.org/x/crypto/chacha20poly1305" diff --git a/transport/snell/pool.go b/transport/snell/pool.go index 2a233a75..cc097df7 100644 --- a/transport/snell/pool.go +++ b/transport/snell/pool.go @@ -5,8 +5,8 @@ import ( "net" "time" - "github.com/Dreamacro/clash/component/pool" - "github.com/Dreamacro/clash/transport/shadowsocks/shadowaead" + "github.com/metacubex/mihomo/component/pool" + "github.com/metacubex/mihomo/transport/shadowsocks/shadowaead" ) type Pool struct { @@ -61,7 +61,7 @@ func (pc *PoolConn) Write(b []byte) (int, error) { } func (pc *PoolConn) Close() error { - // clash use SetReadDeadline to break bidirectional copy between client and server. + // mihomo use SetReadDeadline to break bidirectional copy between client and server. // reset it before reuse connection to avoid io timeout error. _ = pc.Snell.Conn.SetReadDeadline(time.Time{}) pc.pool.Put(pc.Snell) diff --git a/transport/snell/snell.go b/transport/snell/snell.go index e2bd2820..fe3e4ee0 100644 --- a/transport/snell/snell.go +++ b/transport/snell/snell.go @@ -8,9 +8,9 @@ import ( "net" "sync" - "github.com/Dreamacro/clash/common/pool" - "github.com/Dreamacro/clash/transport/shadowsocks/shadowaead" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/common/pool" + "github.com/metacubex/mihomo/transport/shadowsocks/shadowaead" + "github.com/metacubex/mihomo/transport/socks5" ) const ( diff --git a/transport/socks4/socks4.go b/transport/socks4/socks4.go index 0d5c5a77..9533a1c0 100644 --- a/transport/socks4/socks4.go +++ b/transport/socks4/socks4.go @@ -9,7 +9,7 @@ import ( "net/netip" "strconv" - "github.com/Dreamacro/clash/component/auth" + "github.com/metacubex/mihomo/component/auth" ) const Version = 0x04 diff --git a/transport/socks5/socks5.go b/transport/socks5/socks5.go index 6f95cce9..c97c370c 100644 --- a/transport/socks5/socks5.go +++ b/transport/socks5/socks5.go @@ -9,7 +9,7 @@ import ( "net/netip" "strconv" - "github.com/Dreamacro/clash/component/auth" + "github.com/metacubex/mihomo/component/auth" ) // Error represents a SOCKS error diff --git a/transport/ssr/obfs/http_simple.go b/transport/ssr/obfs/http_simple.go index c91cca49..359ca342 100644 --- a/transport/ssr/obfs/http_simple.go +++ b/transport/ssr/obfs/http_simple.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/Dreamacro/clash/common/pool" + "github.com/metacubex/mihomo/common/pool" "github.com/zhangyunhao116/fastrand" ) diff --git a/transport/ssr/obfs/random_head.go b/transport/ssr/obfs/random_head.go index 4c55d951..9a2072fe 100644 --- a/transport/ssr/obfs/random_head.go +++ b/transport/ssr/obfs/random_head.go @@ -5,7 +5,7 @@ import ( "hash/crc32" "net" - "github.com/Dreamacro/clash/common/pool" + "github.com/metacubex/mihomo/common/pool" "github.com/zhangyunhao116/fastrand" ) diff --git a/transport/ssr/obfs/tls1.2_ticket_auth.go b/transport/ssr/obfs/tls1.2_ticket_auth.go index af945133..d5e3ca88 100644 --- a/transport/ssr/obfs/tls1.2_ticket_auth.go +++ b/transport/ssr/obfs/tls1.2_ticket_auth.go @@ -8,8 +8,8 @@ import ( "strings" "time" - "github.com/Dreamacro/clash/common/pool" - "github.com/Dreamacro/clash/transport/ssr/tools" + "github.com/metacubex/mihomo/common/pool" + "github.com/metacubex/mihomo/transport/ssr/tools" "github.com/zhangyunhao116/fastrand" ) diff --git a/transport/ssr/protocol/auth_aes128_md5.go b/transport/ssr/protocol/auth_aes128_md5.go index d3bc9417..c6ae415e 100644 --- a/transport/ssr/protocol/auth_aes128_md5.go +++ b/transport/ssr/protocol/auth_aes128_md5.go @@ -1,6 +1,6 @@ package protocol -import "github.com/Dreamacro/clash/transport/ssr/tools" +import "github.com/metacubex/mihomo/transport/ssr/tools" func init() { register("auth_aes128_md5", newAuthAES128MD5, 9) diff --git a/transport/ssr/protocol/auth_aes128_sha1.go b/transport/ssr/protocol/auth_aes128_sha1.go index e2f0e143..6ee4160e 100644 --- a/transport/ssr/protocol/auth_aes128_sha1.go +++ b/transport/ssr/protocol/auth_aes128_sha1.go @@ -8,10 +8,10 @@ import ( "strconv" "strings" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/pool" - "github.com/Dreamacro/clash/log" - "github.com/Dreamacro/clash/transport/ssr/tools" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/pool" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/transport/ssr/tools" "github.com/zhangyunhao116/fastrand" ) diff --git a/transport/ssr/protocol/auth_chain_a.go b/transport/ssr/protocol/auth_chain_a.go index 12345db6..396172ef 100644 --- a/transport/ssr/protocol/auth_chain_a.go +++ b/transport/ssr/protocol/auth_chain_a.go @@ -12,11 +12,11 @@ import ( "strconv" "strings" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/pool" - "github.com/Dreamacro/clash/log" - "github.com/Dreamacro/clash/transport/shadowsocks/core" - "github.com/Dreamacro/clash/transport/ssr/tools" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/pool" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/transport/shadowsocks/core" + "github.com/metacubex/mihomo/transport/ssr/tools" ) func init() { @@ -108,7 +108,7 @@ func (a *authChainA) Decode(dst, src *bytes.Buffer) error { dataLength := int(binary.LittleEndian.Uint16(src.Bytes()[:2]) ^ binary.LittleEndian.Uint16(a.lastServerHash[14:16])) randDataLength := a.randDataLength(dataLength, a.lastServerHash, &a.randomServer) length := dataLength + randDataLength - // Temporary workaround for https://github.com/Dreamacro/clash/issues/1352 + // Temporary workaround for https://github.com/metacubex/mihomo/issues/1352 if dataLength < 0 || randDataLength < 0 || length < 0 { return errors.New("ssr crashing blocked") } @@ -135,7 +135,7 @@ func (a *authChainA) Decode(dst, src *bytes.Buffer) error { if dataLength > 0 && randDataLength > 0 { pos += getRandStartPos(randDataLength, &a.randomServer) } - // Temporary workaround for https://github.com/Dreamacro/clash/issues/1352 + // Temporary workaround for https://github.com/metacubex/mihomo/issues/1352 if pos < 0 || pos+dataLength < 0 || dataLength < 0 { return errors.New("ssr crashing blocked") } diff --git a/transport/ssr/protocol/auth_chain_b.go b/transport/ssr/protocol/auth_chain_b.go index 857b2a3a..223613a9 100644 --- a/transport/ssr/protocol/auth_chain_b.go +++ b/transport/ssr/protocol/auth_chain_b.go @@ -4,7 +4,7 @@ import ( "net" "sort" - "github.com/Dreamacro/clash/transport/ssr/tools" + "github.com/metacubex/mihomo/transport/ssr/tools" ) func init() { diff --git a/transport/ssr/protocol/auth_sha1_v4.go b/transport/ssr/protocol/auth_sha1_v4.go index 26039181..ed1a39f1 100644 --- a/transport/ssr/protocol/auth_sha1_v4.go +++ b/transport/ssr/protocol/auth_sha1_v4.go @@ -7,9 +7,9 @@ import ( "hash/crc32" "net" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/pool" - "github.com/Dreamacro/clash/transport/ssr/tools" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/pool" + "github.com/metacubex/mihomo/transport/ssr/tools" "github.com/zhangyunhao116/fastrand" ) diff --git a/transport/ssr/protocol/base.go b/transport/ssr/protocol/base.go index a826bec8..e26a6587 100644 --- a/transport/ssr/protocol/base.go +++ b/transport/ssr/protocol/base.go @@ -9,9 +9,9 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/common/pool" - "github.com/Dreamacro/clash/log" - "github.com/Dreamacro/clash/transport/shadowsocks/core" + "github.com/metacubex/mihomo/common/pool" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/transport/shadowsocks/core" "github.com/zhangyunhao116/fastrand" ) diff --git a/transport/ssr/protocol/origin.go b/transport/ssr/protocol/origin.go index 52525a2f..4d8b630a 100644 --- a/transport/ssr/protocol/origin.go +++ b/transport/ssr/protocol/origin.go @@ -4,7 +4,7 @@ import ( "bytes" "net" - N "github.com/Dreamacro/clash/common/net" + N "github.com/metacubex/mihomo/common/net" ) type origin struct{} diff --git a/transport/ssr/protocol/packet.go b/transport/ssr/protocol/packet.go index 988ff75d..86d573f3 100644 --- a/transport/ssr/protocol/packet.go +++ b/transport/ssr/protocol/packet.go @@ -3,8 +3,8 @@ package protocol import ( "net" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/pool" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/pool" ) type PacketConn struct { diff --git a/transport/ssr/protocol/protocol.go b/transport/ssr/protocol/protocol.go index 1c27da48..a04e6bd4 100644 --- a/transport/ssr/protocol/protocol.go +++ b/transport/ssr/protocol/protocol.go @@ -6,7 +6,7 @@ import ( "fmt" "net" - N "github.com/Dreamacro/clash/common/net" + N "github.com/metacubex/mihomo/common/net" "github.com/zhangyunhao116/fastrand" ) diff --git a/transport/ssr/protocol/stream.go b/transport/ssr/protocol/stream.go index 3c846157..436859c3 100644 --- a/transport/ssr/protocol/stream.go +++ b/transport/ssr/protocol/stream.go @@ -4,7 +4,7 @@ import ( "bytes" "net" - "github.com/Dreamacro/clash/common/pool" + "github.com/metacubex/mihomo/common/pool" ) type Conn struct { diff --git a/transport/ssr/tools/random.go b/transport/ssr/tools/random.go index 338543ea..c76011e4 100644 --- a/transport/ssr/tools/random.go +++ b/transport/ssr/tools/random.go @@ -3,7 +3,7 @@ package tools import ( "encoding/binary" - "github.com/Dreamacro/clash/common/pool" + "github.com/metacubex/mihomo/common/pool" ) // XorShift128Plus - a pseudorandom number generator diff --git a/transport/trojan/trojan.go b/transport/trojan/trojan.go index 20ba80b3..c4bd1167 100644 --- a/transport/trojan/trojan.go +++ b/transport/trojan/trojan.go @@ -12,13 +12,13 @@ import ( "net/http" "sync" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/pool" - "github.com/Dreamacro/clash/component/ca" - tlsC "github.com/Dreamacro/clash/component/tls" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/socks5" - "github.com/Dreamacro/clash/transport/vmess" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/pool" + "github.com/metacubex/mihomo/component/ca" + tlsC "github.com/metacubex/mihomo/component/tls" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/socks5" + "github.com/metacubex/mihomo/transport/vmess" ) const ( diff --git a/transport/tuic/common/congestion.go b/transport/tuic/common/congestion.go index 13c1300f..485e2e6a 100644 --- a/transport/tuic/common/congestion.go +++ b/transport/tuic/common/congestion.go @@ -1,8 +1,8 @@ package common import ( - "github.com/Dreamacro/clash/transport/tuic/congestion" - congestionv2 "github.com/Dreamacro/clash/transport/tuic/congestion_v2" + "github.com/metacubex/mihomo/transport/tuic/congestion" + congestionv2 "github.com/metacubex/mihomo/transport/tuic/congestion_v2" "github.com/metacubex/quic-go" c "github.com/metacubex/quic-go/congestion" diff --git a/transport/tuic/common/type.go b/transport/tuic/common/type.go index 9a568dd7..c663fa0b 100644 --- a/transport/tuic/common/type.go +++ b/transport/tuic/common/type.go @@ -7,8 +7,8 @@ import ( "net" "time" - N "github.com/Dreamacro/clash/common/net" - C "github.com/Dreamacro/clash/constant" + N "github.com/metacubex/mihomo/common/net" + C "github.com/metacubex/mihomo/constant" "github.com/metacubex/quic-go" ) diff --git a/transport/tuic/pool_client.go b/transport/tuic/pool_client.go index 4a779706..e492fba7 100644 --- a/transport/tuic/pool_client.go +++ b/transport/tuic/pool_client.go @@ -8,10 +8,10 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/common/generics/list" - N "github.com/Dreamacro/clash/common/net" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/common/generics/list" + N "github.com/metacubex/mihomo/common/net" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" "github.com/metacubex/quic-go" ) diff --git a/transport/tuic/server.go b/transport/tuic/server.go index cabc04e0..a273e462 100644 --- a/transport/tuic/server.go +++ b/transport/tuic/server.go @@ -7,14 +7,14 @@ import ( "net" "time" - "github.com/Dreamacro/clash/adapter/inbound" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/utils" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/socks5" - "github.com/Dreamacro/clash/transport/tuic/common" - v4 "github.com/Dreamacro/clash/transport/tuic/v4" - v5 "github.com/Dreamacro/clash/transport/tuic/v5" + "github.com/metacubex/mihomo/adapter/inbound" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/utils" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/socks5" + "github.com/metacubex/mihomo/transport/tuic/common" + v4 "github.com/metacubex/mihomo/transport/tuic/v4" + v5 "github.com/metacubex/mihomo/transport/tuic/v5" "github.com/gofrs/uuid/v5" "github.com/metacubex/quic-go" diff --git a/transport/tuic/tuic.go b/transport/tuic/tuic.go index 387a152c..02aaa3ad 100644 --- a/transport/tuic/tuic.go +++ b/transport/tuic/tuic.go @@ -1,10 +1,10 @@ package tuic import ( - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/tuic/common" - v4 "github.com/Dreamacro/clash/transport/tuic/v4" - v5 "github.com/Dreamacro/clash/transport/tuic/v5" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/tuic/common" + v4 "github.com/metacubex/mihomo/transport/tuic/v4" + v5 "github.com/metacubex/mihomo/transport/tuic/v5" ) type ClientOptionV4 = v4.ClientOption diff --git a/transport/tuic/v4/client.go b/transport/tuic/v4/client.go index ce33b72b..0bc8f9bb 100644 --- a/transport/tuic/v4/client.go +++ b/transport/tuic/v4/client.go @@ -13,13 +13,13 @@ import ( "time" "unsafe" - atomic2 "github.com/Dreamacro/clash/common/atomic" - "github.com/Dreamacro/clash/common/buf" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/pool" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" - "github.com/Dreamacro/clash/transport/tuic/common" + atomic2 "github.com/metacubex/mihomo/common/atomic" + "github.com/metacubex/mihomo/common/buf" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/pool" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/transport/tuic/common" "github.com/metacubex/quic-go" "github.com/puzpuzpuz/xsync/v2" diff --git a/transport/tuic/v4/packet.go b/transport/tuic/v4/packet.go index 2066ceb7..5bd6504c 100644 --- a/transport/tuic/v4/packet.go +++ b/transport/tuic/v4/packet.go @@ -5,10 +5,10 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/common/atomic" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/pool" - "github.com/Dreamacro/clash/transport/tuic/common" + "github.com/metacubex/mihomo/common/atomic" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/pool" + "github.com/metacubex/mihomo/transport/tuic/common" "github.com/metacubex/quic-go" ) diff --git a/transport/tuic/v4/protocol.go b/transport/tuic/v4/protocol.go index bbdca67c..29536742 100644 --- a/transport/tuic/v4/protocol.go +++ b/transport/tuic/v4/protocol.go @@ -11,8 +11,8 @@ import ( "github.com/metacubex/quic-go" "lukechampine.com/blake3" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/socks5" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/socks5" ) type BufferedReader interface { diff --git a/transport/tuic/v4/server.go b/transport/tuic/v4/server.go index 56133fea..c4e4d735 100644 --- a/transport/tuic/v4/server.go +++ b/transport/tuic/v4/server.go @@ -7,13 +7,13 @@ import ( "net" "sync" - "github.com/Dreamacro/clash/adapter/inbound" - "github.com/Dreamacro/clash/common/atomic" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/pool" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/socks5" - "github.com/Dreamacro/clash/transport/tuic/common" + "github.com/metacubex/mihomo/adapter/inbound" + "github.com/metacubex/mihomo/common/atomic" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/pool" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/socks5" + "github.com/metacubex/mihomo/transport/tuic/common" "github.com/gofrs/uuid/v5" "github.com/metacubex/quic-go" diff --git a/transport/tuic/v5/client.go b/transport/tuic/v5/client.go index c4ac25d4..e37d60fc 100644 --- a/transport/tuic/v5/client.go +++ b/transport/tuic/v5/client.go @@ -12,12 +12,12 @@ import ( "sync/atomic" "time" - atomic2 "github.com/Dreamacro/clash/common/atomic" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/pool" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" - "github.com/Dreamacro/clash/transport/tuic/common" + atomic2 "github.com/metacubex/mihomo/common/atomic" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/pool" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/transport/tuic/common" "github.com/metacubex/quic-go" "github.com/puzpuzpuz/xsync/v2" diff --git a/transport/tuic/v5/frag.go b/transport/tuic/v5/frag.go index 8df9f785..4e07a1c7 100644 --- a/transport/tuic/v5/frag.go +++ b/transport/tuic/v5/frag.go @@ -4,7 +4,7 @@ import ( "bytes" "sync" - "github.com/Dreamacro/clash/common/cache" + "github.com/metacubex/mihomo/common/cache" "github.com/metacubex/quic-go" ) diff --git a/transport/tuic/v5/packet.go b/transport/tuic/v5/packet.go index efbe0bb9..8ab45068 100644 --- a/transport/tuic/v5/packet.go +++ b/transport/tuic/v5/packet.go @@ -6,10 +6,10 @@ import ( "sync" "time" - "github.com/Dreamacro/clash/common/atomic" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/pool" - "github.com/Dreamacro/clash/transport/tuic/common" + "github.com/metacubex/mihomo/common/atomic" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/pool" + "github.com/metacubex/mihomo/transport/tuic/common" "github.com/metacubex/quic-go" "github.com/zhangyunhao116/fastrand" diff --git a/transport/tuic/v5/protocol.go b/transport/tuic/v5/protocol.go index 964401e1..de51a080 100644 --- a/transport/tuic/v5/protocol.go +++ b/transport/tuic/v5/protocol.go @@ -8,9 +8,9 @@ import ( "net/netip" "strconv" - "github.com/Dreamacro/clash/common/utils" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/socks5" + "github.com/metacubex/mihomo/common/utils" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/socks5" "github.com/metacubex/quic-go" ) diff --git a/transport/tuic/v5/server.go b/transport/tuic/v5/server.go index 10003a9d..c8170f62 100644 --- a/transport/tuic/v5/server.go +++ b/transport/tuic/v5/server.go @@ -7,12 +7,12 @@ import ( "net" "sync" - "github.com/Dreamacro/clash/adapter/inbound" - "github.com/Dreamacro/clash/common/atomic" - N "github.com/Dreamacro/clash/common/net" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/transport/socks5" - "github.com/Dreamacro/clash/transport/tuic/common" + "github.com/metacubex/mihomo/adapter/inbound" + "github.com/metacubex/mihomo/common/atomic" + N "github.com/metacubex/mihomo/common/net" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/socks5" + "github.com/metacubex/mihomo/transport/tuic/common" "github.com/gofrs/uuid/v5" "github.com/metacubex/quic-go" diff --git a/transport/v2ray-plugin/websocket.go b/transport/v2ray-plugin/websocket.go index 9cb4420c..1c7056d6 100644 --- a/transport/v2ray-plugin/websocket.go +++ b/transport/v2ray-plugin/websocket.go @@ -6,8 +6,8 @@ import ( "net" "net/http" - "github.com/Dreamacro/clash/component/ca" - "github.com/Dreamacro/clash/transport/vmess" + "github.com/metacubex/mihomo/component/ca" + "github.com/metacubex/mihomo/transport/vmess" ) // Option is options of websocket obfs diff --git a/transport/vless/config.pb.go b/transport/vless/config.pb.go index 1407e4d7..14fcc5f9 100644 --- a/transport/vless/config.pb.go +++ b/transport/vless/config.pb.go @@ -108,7 +108,7 @@ func file_transport_vless_config_proto_rawDescGZIP() []byte { var file_transport_vless_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_transport_vless_config_proto_goTypes = []interface{}{ - (*Addons)(nil), // 0: clash.transport.vless.Addons + (*Addons)(nil), // 0: mihomo.transport.vless.Addons } var file_transport_vless_config_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type diff --git a/transport/vless/config.proto b/transport/vless/config.proto index 80900230..44cad479 100644 --- a/transport/vless/config.proto +++ b/transport/vless/config.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package clash.transport.vless; -option csharp_namespace = "Clash.Transport.Vless"; -option go_package = "github.com/Dreamacro/clash/transport/vless"; -option java_package = "com.clash.transport.vless"; +package mihomo.transport.vless; +option csharp_namespace = "Mihomo.Transport.Vless"; +option go_package = "github.com/metacubex/mihomo/transport/vless"; +option java_package = "com.mihomo.transport.vless"; option java_multiple_files = true; message Addons { diff --git a/transport/vless/conn.go b/transport/vless/conn.go index 33ecd97a..02224892 100644 --- a/transport/vless/conn.go +++ b/transport/vless/conn.go @@ -7,9 +7,9 @@ import ( "net" "sync" - "github.com/Dreamacro/clash/common/buf" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/transport/vless/vision" + "github.com/metacubex/mihomo/common/buf" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/transport/vless/vision" "github.com/gofrs/uuid/v5" "google.golang.org/protobuf/proto" diff --git a/transport/vless/vision/conn.go b/transport/vless/vision/conn.go index 03f524aa..79c77835 100644 --- a/transport/vless/vision/conn.go +++ b/transport/vless/vision/conn.go @@ -9,9 +9,9 @@ import ( "io" "net" - "github.com/Dreamacro/clash/common/buf" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/common/buf" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/log" "github.com/gofrs/uuid/v5" utls "github.com/sagernet/utls" diff --git a/transport/vless/vision/filter.go b/transport/vless/vision/filter.go index e070de35..55b5663f 100644 --- a/transport/vless/vision/filter.go +++ b/transport/vless/vision/filter.go @@ -4,7 +4,7 @@ import ( "bytes" "encoding/binary" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/log" ) var ( diff --git a/transport/vless/vision/padding.go b/transport/vless/vision/padding.go index d5a230d1..e5f9dc85 100644 --- a/transport/vless/vision/padding.go +++ b/transport/vless/vision/padding.go @@ -4,8 +4,8 @@ import ( "bytes" "encoding/binary" - "github.com/Dreamacro/clash/common/buf" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/common/buf" + "github.com/metacubex/mihomo/log" "github.com/gofrs/uuid/v5" "github.com/zhangyunhao116/fastrand" diff --git a/transport/vless/vision/vision.go b/transport/vless/vision/vision.go index 3b52dd4b..09299b23 100644 --- a/transport/vless/vision/vision.go +++ b/transport/vless/vision/vision.go @@ -10,8 +10,8 @@ import ( "reflect" "unsafe" - N "github.com/Dreamacro/clash/common/net" - tlsC "github.com/Dreamacro/clash/component/tls" + N "github.com/metacubex/mihomo/common/net" + tlsC "github.com/metacubex/mihomo/component/tls" "github.com/gofrs/uuid/v5" "github.com/sagernet/sing/common" diff --git a/transport/vless/vless.go b/transport/vless/vless.go index 6c01b839..ce07cdb4 100644 --- a/transport/vless/vless.go +++ b/transport/vless/vless.go @@ -3,7 +3,7 @@ package vless import ( "net" - "github.com/Dreamacro/clash/common/utils" + "github.com/metacubex/mihomo/common/utils" "github.com/gofrs/uuid/v5" ) diff --git a/transport/vmess/aead.go b/transport/vmess/aead.go index d4fbf2d9..89ec6a3b 100644 --- a/transport/vmess/aead.go +++ b/transport/vmess/aead.go @@ -7,7 +7,7 @@ import ( "io" "sync" - "github.com/Dreamacro/clash/common/pool" + "github.com/metacubex/mihomo/common/pool" ) type aeadWriter struct { diff --git a/transport/vmess/chunk.go b/transport/vmess/chunk.go index ab1adb6d..f52fc82c 100644 --- a/transport/vmess/chunk.go +++ b/transport/vmess/chunk.go @@ -5,7 +5,7 @@ import ( "errors" "io" - "github.com/Dreamacro/clash/common/pool" + "github.com/metacubex/mihomo/common/pool" ) const ( diff --git a/transport/vmess/http.go b/transport/vmess/http.go index d9e73f68..782e7eb2 100644 --- a/transport/vmess/http.go +++ b/transport/vmess/http.go @@ -8,7 +8,7 @@ import ( "net/http" "net/textproto" - "github.com/Dreamacro/clash/common/util" + "github.com/metacubex/mihomo/common/util" "github.com/zhangyunhao116/fastrand" ) diff --git a/transport/vmess/tls.go b/transport/vmess/tls.go index 8bcb6513..bdaa8ccc 100644 --- a/transport/vmess/tls.go +++ b/transport/vmess/tls.go @@ -6,8 +6,8 @@ import ( "errors" "net" - "github.com/Dreamacro/clash/component/ca" - tlsC "github.com/Dreamacro/clash/component/tls" + "github.com/metacubex/mihomo/component/ca" + tlsC "github.com/metacubex/mihomo/component/tls" ) type TLSConfig struct { diff --git a/transport/vmess/vmess.go b/transport/vmess/vmess.go index 2dd071eb..7c587c6a 100644 --- a/transport/vmess/vmess.go +++ b/transport/vmess/vmess.go @@ -5,7 +5,7 @@ import ( "net" "runtime" - "github.com/Dreamacro/clash/common/utils" + "github.com/metacubex/mihomo/common/utils" "github.com/gofrs/uuid/v5" "github.com/zhangyunhao116/fastrand" diff --git a/transport/vmess/websocket.go b/transport/vmess/websocket.go index 9f09185b..b30bb8aa 100644 --- a/transport/vmess/websocket.go +++ b/transport/vmess/websocket.go @@ -18,10 +18,10 @@ import ( "strings" "time" - "github.com/Dreamacro/clash/common/buf" - N "github.com/Dreamacro/clash/common/net" - tlsC "github.com/Dreamacro/clash/component/tls" - "github.com/Dreamacro/clash/log" + "github.com/metacubex/mihomo/common/buf" + N "github.com/metacubex/mihomo/common/net" + tlsC "github.com/metacubex/mihomo/component/tls" + "github.com/metacubex/mihomo/log" "github.com/gobwas/ws" "github.com/gobwas/ws/wsutil" diff --git a/tunnel/connection.go b/tunnel/connection.go index 9fc4f405..33cc4e8d 100644 --- a/tunnel/connection.go +++ b/tunnel/connection.go @@ -6,9 +6,9 @@ import ( "net/netip" "time" - N "github.com/Dreamacro/clash/common/net" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/log" + N "github.com/metacubex/mihomo/common/net" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" ) func handleUDPToRemote(packet C.UDPPacket, pc C.PacketConn, metadata *C.Metadata) error { diff --git a/tunnel/statistic/manager.go b/tunnel/statistic/manager.go index 4797829f..8e962dae 100644 --- a/tunnel/statistic/manager.go +++ b/tunnel/statistic/manager.go @@ -4,7 +4,7 @@ import ( "os" "time" - "github.com/Dreamacro/clash/common/atomic" + "github.com/metacubex/mihomo/common/atomic" "github.com/puzpuzpuz/xsync/v2" "github.com/shirou/gopsutil/v3/process" diff --git a/tunnel/statistic/tracker.go b/tunnel/statistic/tracker.go index bc2dbd5c..0bf7995d 100644 --- a/tunnel/statistic/tracker.go +++ b/tunnel/statistic/tracker.go @@ -6,11 +6,11 @@ import ( "net/netip" "time" - "github.com/Dreamacro/clash/common/atomic" - "github.com/Dreamacro/clash/common/buf" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/common/utils" - C "github.com/Dreamacro/clash/constant" + "github.com/metacubex/mihomo/common/atomic" + "github.com/metacubex/mihomo/common/buf" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/common/utils" + C "github.com/metacubex/mihomo/constant" "github.com/gofrs/uuid/v5" ) diff --git a/tunnel/tunnel.go b/tunnel/tunnel.go index fe37d75e..596e26d7 100644 --- a/tunnel/tunnel.go +++ b/tunnel/tunnel.go @@ -12,16 +12,16 @@ import ( "github.com/jpillora/backoff" - N "github.com/Dreamacro/clash/common/net" - "github.com/Dreamacro/clash/component/nat" - P "github.com/Dreamacro/clash/component/process" - "github.com/Dreamacro/clash/component/resolver" - "github.com/Dreamacro/clash/component/sniffer" - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/constant/provider" - icontext "github.com/Dreamacro/clash/context" - "github.com/Dreamacro/clash/log" - "github.com/Dreamacro/clash/tunnel/statistic" + N "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/component/nat" + P "github.com/metacubex/mihomo/component/process" + "github.com/metacubex/mihomo/component/resolver" + "github.com/metacubex/mihomo/component/sniffer" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/constant/provider" + icontext "github.com/metacubex/mihomo/context" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/tunnel/statistic" ) var (