Skip to content

Commit

Permalink
FixedBUG: outbound network or transport not support . only support tc…
Browse files Browse the repository at this point in the history
…p, ws or websocket
  • Loading branch information
iotames committed Jun 19, 2024
1 parent 65030ea commit 2c33e03
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion decode/shadowsocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ func ParseShadowsocks(u string) (ss Shadowsocks, err error) {
}
}
}

if ss.TransportStream.Protocol == "" {
ss.TransportStream.Protocol = "tcp"
}
if ss.TransportStream.Protocol == "websocket" {
ss.TransportStream.Protocol = "ws"
}
Expand Down
8 changes: 6 additions & 2 deletions v2rayapi/streamconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package v2rayapi

import (
"fmt"
"strings"

"github.com/golang/protobuf/proto"
"github.com/v2fly/v2ray-core/v5/common/serial"
Expand All @@ -11,7 +12,10 @@ import (
)

func GetTransportStreamConfig(network, path, hdhost string) (conf *internet.StreamConfig, err error) {
transproto := network
transproto := strings.TrimSpace(network)
if transproto == "" {
transproto = "tcp"
}
var transptl internet.TransportProtocol
var protoconf proto.Message
switch transproto {
Expand All @@ -27,7 +31,7 @@ func GetTransportStreamConfig(network, path, hdhost string) (conf *internet.Stre
transptl = internet.TransportProtocol_TCP
protoconf = &tcp.Config{}
default:
err = fmt.Errorf("outbound network or transport not support %s. only support tcp, ws or websocket", transproto)
err = fmt.Errorf("outbound network or transport not support (%s). only support tcp, ws or websocket", transproto)
}
if err != nil {
return
Expand Down

0 comments on commit 2c33e03

Please sign in to comment.