summaryrefslogtreecommitdiff
path: root/xmake/scripts/pac/github_mirror.lua
blob: 3b4b3b4e8f5358405bd57bf5f11a7432e8acd681 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import("net.fasturl")

function mirror(url)
    local configs = {}
    local proxyurls = {"hub.fastgit.xyz"}
    fasturl.add(proxyurls)
    proxyurls = fasturl.sort(proxyurls)
    if #proxyurls > 0 then
        return url:replace("/github.com/", "/" .. proxyurls[1] .. "/", {plain = true})
    end
end