Xray-core
Xray-core copied to clipboard
[bug] grpc connection fail with proxySettings
with V2Ray 4.44.0
, the following outbound configuration should work just fine:
{
"tag": "trojan",
"protocol": "trojan",
"settings": {
"servers": [
{
"address": "172.18.0.2",
"port": 8080,
"password": "password"
}
]
},
"proxySettings": {
"tag": "transit", // a socks5 exit outbound.
"transportLayer": true
},
"streamSettings": {
"network": "grpc",
"security": "tls",
"grpcSettings": {
"serviceName": "proxy"
},
"tlsSettings": {
"serverName": "example.com",
"alpn": [
"h2"
],
"allowInsecure": true
}
}
}
However, with Xray v1.5.2
, errors are reported.
2021/12/30 18:19:10 [Info] [519392493] app/proxyman/outbound: failed to process outbound traffic > proxy/trojan: connection ends > transport/internet/grpc/encoding: failed to fetch hunk from gRPC tunnel > rpc error: code = Unavailable desc = transport is closing
2021/12/30 18:19:10 [Info] [1866590884] app/proxyman/outbound: failed to process outbound traffic > proxy/trojan: connection ends > transport/internet/grpc/encoding: failed to fetch hunk from gRPC tunnel > rpc error: code = Unavailable desc = transport is closing
2021/12/30 18:19:10 [Info] [519392493] app/proxyman/inbound: connection ends > proxy/socks: connection ends > proxy/socks: failed to transport all TCP response > io: read/write on closed pipe
2021/12/30 18:19:10 [Warning] [1639575845] app/proxyman/outbound: failed to process outbound traffic > proxy/trojan: connection ends > proxy/trojan: failed to flush payload > transport/internet/grpc/encoding: failed to send data over gRPC tunnel > EOF
2021/12/30 18:19:10 [Info] [1639575845] app/proxyman/inbound: connection ends > proxy/socks: connection ends > proxy/socks: failed to transport all TCP response > io: read/write on closed pipe
https://xtls.github.io/config/transport.html#sockoptobject try dialerProxy
xtls.github.io/config/transport.html#sockoptobject try dialerProxy
Same error reported:
2021/12/30 18:19:10 [Warning] [1639575845] app/proxyman/outbound: failed to process outbound traffic > proxy/trojan: connection ends > proxy/trojan: failed to flush payload > transport/internet/grpc/encoding: failed to send data over gRPC tunnel > EOF
There is a workaround for this bug, I am trying to use inboundDetour
to mock dialerProxy
or proxySettings
:
{
"routing": {
"domainStrategy": "IPIfNonMatch",
"domainMatcher": "mph",
"rules": [
{
"type": "field",
"inboundTag": [
"bridge"
],
"outboundTag": "transit"
},
{
"type": "field",
"inboundTag": [
"socks"
],
"outboundTag": "trojan"
}
]
},
"inboundDetour": [
{
"tag": "bridge",
"listen": "172.18.0.4",
"port": 9090,
"protocol": "dokodemo-door",
"settings": {
"network": "tcp",
"address": "172.16.5.32",
"port": 9090
}
}
]
}
我也遇到了同样的情况,我是使用grpc传输vless,加上前置代理就不行了
这个proxysettings不经过底层传输
这个proxysettings不经过底层传输