1
0
mirror of https://github.com/nitezs/sub2clash.git synced 2024-12-24 12:24:41 -05:00
sub2clash/model/proxy_hysteria.go

59 lines
2.3 KiB
Go
Raw Normal View History

2024-03-09 04:01:52 -05:00
package model
type Hysteria struct {
Type string `yaml:"type"`
Name string `yaml:"name"`
Server string `yaml:"server"`
Port int `yaml:"port,omitempty"`
Ports string `yaml:"ports,omitempty"`
Protocol string `yaml:"protocol,omitempty"`
2024-08-11 11:55:47 -04:00
ObfsProtocol string `yaml:"obfs-protocol,omitempty"`
2024-03-09 04:01:52 -05:00
Up string `yaml:"up"`
2024-08-11 11:55:47 -04:00
UpSpeed int `yaml:"up-speed,omitempty"`
2024-03-09 04:01:52 -05:00
Down string `yaml:"down"`
2024-08-11 11:55:47 -04:00
DownSpeed int `yaml:"down-speed,omitempty"`
2024-03-09 04:01:52 -05:00
Auth string `yaml:"auth,omitempty"`
AuthStringOLD string `yaml:"auth_str,omitempty"`
2024-03-09 04:01:52 -05:00
AuthString string `yaml:"auth-str,omitempty"`
Obfs string `yaml:"obfs,omitempty"`
SNI string `yaml:"sni,omitempty"`
SkipCertVerify bool `yaml:"skip-cert-verify,omitempty"`
Fingerprint string `yaml:"fingerprint,omitempty"`
ALPN []string `yaml:"alpn,omitempty"`
CustomCA string `yaml:"ca,omitempty"`
CustomCAString string `yaml:"ca-str,omitempty"`
ReceiveWindowConn int `yaml:"recv-window-conn,omitempty"`
ReceiveWindow int `yaml:"recv-window,omitempty"`
DisableMTUDiscovery bool `yaml:"disable-mtu-discovery,omitempty"`
FastOpen bool `yaml:"fast-open,omitempty"`
HopInterval int `yaml:"hop-interval,omitempty"`
}
func ProxyToHysteria(p Proxy) Hysteria {
return Hysteria{
Type: "hysteria",
Name: p.Name,
Server: p.Server,
Port: p.Port,
Ports: p.Ports,
Protocol: p.Protocol,
2024-03-09 04:01:52 -05:00
Up: p.Up,
Down: p.Down,
Auth: p.Auth,
2024-03-11 00:30:16 -04:00
AuthStringOLD: p.AuthStringOLD,
AuthString: p.AuthString,
2024-03-09 04:01:52 -05:00
Obfs: p.Obfs,
SNI: p.Sni,
SkipCertVerify: p.SkipCertVerify,
Fingerprint: p.Fingerprint,
ALPN: p.Alpn,
CustomCA: p.CustomCA,
CustomCAString: p.CustomCAString,
ReceiveWindowConn: p.ReceiveWindowConn,
ReceiveWindow: p.ReceiveWindow,
DisableMTUDiscovery: p.DisableMTUDiscovery,
FastOpen: p.FastOpen,
HopInterval: p.HopInterval,
}
}