Skip to content

Commit 9b9d265

Browse files
committed
add userpass support for hy2
1 parent b5fbdcf commit 9b9d265

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ray2sing/hysteria2.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,17 @@ func Hysteria2Singbox(hysteria2Url string) (*T.Outbound, error) {
3737
if err != nil {
3838
return nil, err
3939
}
40+
pass := u.Username
41+
if u.Password != "" {
42+
pass += ":" + u.Password
43+
}
4044
result := T.Outbound{
4145
Type: "hysteria2",
4246
Tag: u.Name,
4347
Hysteria2Options: T.Hysteria2OutboundOptions{
4448
ServerOptions: u.GetServerOption(),
4549
Obfs: ObfsOpts,
46-
Password: u.Username,
50+
Password: pass,
4751
OutboundTLSOptionsContainer: T.OutboundTLSOptionsContainer{
4852
TLS: &T.OutboundTLSOptions{
4953
Enabled: true,

0 commit comments

Comments
 (0)