Created
March 16, 2024 15:12
-
-
Save vimagick/2973a938d9bfab37a988dc760a2f3ad6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
yq -o json | jq -r ' | |
.proxies[] | | |
if .type == "ss" then | |
(["ss://", ("\(.cipher):\(.password)"|@base64), "@\(.server):\(.port)"] | join("")) | |
elif .type == "vmess" then | |
({v:"2", ps:.name, add:.server, port:.port, id:.uuid, aid:.alterId, scy:.cipher, net:.network, host:.["ws-opts"].headers.Host, path:.["ws-opts"].path, tls:(if .tls then "tls" else "" end)} | "vmess://\(.|@json|@base64)") | |
elif .type == "trojan" then | |
("trojan://\(.password)@\(.server):\(.port)?sni=\(.sni)&allowInsecure=1" + (if .network == "ws" then "&type=\(.network)&path=\(.["ws-opts"].path)" else "" end)) | |
else | |
empty | |
end | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment