Skip to content

Commit

Permalink
Fix: grpc transport path should not escape
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamacro committed Aug 19, 2021
1 parent 47044ec commit 847f419
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/config/vmess-grpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
]
},
"grpcSettings": {
"serviceName": "example"
"serviceName": "example!"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/vmess_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ func TestClash_VmessGrpc(t *testing.T) {
UDP: true,
ServerName: "example.org",
GrpcOpts: outbound.GrpcOptions{
GrpcServiceName: "example",
GrpcServiceName: "example!",
},
})
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions transport/gun/gun.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ func StreamGunWithTransport(transport *http2.Transport, cfg *Config) (net.Conn,
Scheme: "https",
Host: cfg.Host,
Path: fmt.Sprintf("/%s/Tun", serviceName),
// for unescape path
Opaque: fmt.Sprintf("//%s/%s/Tun", cfg.Host, serviceName),
},
Proto: "HTTP/2",
ProtoMajor: 2,
Expand Down

0 comments on commit 847f419

Please sign in to comment.