Skip to content

Commit

Permalink
add userpass support for hy2
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Jul 30, 2024
1 parent b5fbdcf commit 9b9d265
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ray2sing/hysteria2.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,17 @@ func Hysteria2Singbox(hysteria2Url string) (*T.Outbound, error) {
if err != nil {
return nil, err
}
pass := u.Username
if u.Password != "" {
pass += ":" + u.Password
}
result := T.Outbound{
Type: "hysteria2",
Tag: u.Name,
Hysteria2Options: T.Hysteria2OutboundOptions{
ServerOptions: u.GetServerOption(),
Obfs: ObfsOpts,
Password: u.Username,
Password: pass,
OutboundTLSOptionsContainer: T.OutboundTLSOptionsContainer{
TLS: &T.OutboundTLSOptions{
Enabled: true,
Expand Down

0 comments on commit 9b9d265

Please sign in to comment.