Add MTProxy, MASQUE, VPN, Link parser. Update AmneziaWG. Remove Tunneling

This commit is contained in:
Sergei Maklagin
2026-04-29 22:11:30 +03:00
parent 09f9f114aa
commit 04908a6a67
158 changed files with 7994 additions and 2277 deletions

36
parser/clash/ssh.go Normal file
View File

@@ -0,0 +1,36 @@
package clash
import (
"strings"
"github.com/sagernet/sing-box/option"
)
type SSHOption struct {
DialerOptions `yaml:",inline"`
ServerOptions `yaml:",inline"`
UserName string `yaml:"username"`
Password string `yaml:"password,omitempty"`
PrivateKey string `yaml:"private-key,omitempty"`
PrivateKeyPassphrase string `yaml:"private-key-passphrase,omitempty"`
HostKey []string `yaml:"host-key,omitempty"`
HostKeyAlgorithms []string `yaml:"host-key-algorithms,omitempty"`
}
func (s *SSHOption) Build() any {
options := &option.SSHOutboundOptions{
DialerOptions: s.DialerOptions.Build(),
ServerOptions: s.ServerOptions.Build(),
User: s.UserName,
Password: s.Password,
PrivateKeyPassphrase: s.PrivateKeyPassphrase,
HostKey: s.HostKey,
HostKeyAlgorithms: s.HostKeyAlgorithms,
}
if strings.Contains(s.PrivateKey, "PRIVATE KEY") {
options.PrivateKey = trimStringArray(strings.Split(s.PrivateKey, "\n"))
} else {
options.PrivateKeyPath = s.PrivateKey
}
return options
}