Xray-core icon indicating copy to clipboard operation
Xray-core copied to clipboard

xray-core 疯狂起线程,电脑直接爆炸

Open 0jinxing opened this issue 2 years ago • 15 comments

服务端配置

{
  "log": {
    "loglevel": "warning"
  },
  "inbounds": [
    {
      "port": 8080,
      "protocol": "vless",
      "settings": {
        "clients": [
          {
            "id": "xxxxxxxxxx",
            "flow": "xtls-rprx-direct"
          }
        ],
        "decryption": "none",
        "fallbacks": [
          {
            "dest": 10443,
            "xver": 1
          }
        ]
      },
      "sniffing": {
        "enabled": true,
        "destOverride": [
          "http",
          "tls"
        ]
      },
      "streamSettings": {
        "network": "tcp",
        "security": "xtls",
        "xtlsSettings": {
          "alpn": [
            "h2",
            "http/1.1"
          ],
          "certificates": [
            {
              "certificateFile": "/etc/ssl/xray/cert.pem",
              "keyFile": "/etc/ssl/xray/privkey.key"
            }
          ]
        }
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom"
    }
  ],
  "routing": {
    "domainStrategy": "IPOnDemand",
    "rules": [
      {
        "domain": [
          "geosite:cn"
        ],
        "outboundTag": "blocked",
        "type": "field"
      },
      {
        "ip": [
          "geoip:cn"
        ],
        "outboundTag": "blocked",
        "type": "field"
      },
      {
        "type": "field",
        "outboundTag": "block",
        "protocol": [
          "bittorrent"
        ]
      }
    ]
  }
}

客户端配置

{
  "log": {
    "loglevel": "warning"
  },
  "inbounds": [
    {
      "port": 1081,
      "listen": "0.0.0.0",
      "protocol": "socks",
      "settings": { "udp": true }
    },
    {
      "port": 1080,
      "listen": "0.0.0.0",
      "protocol": "http"
    }
  ],
  "outbounds": [
    {
      "protocol": "vless",
      "settings": {
        "vnext": [
          {
            "address": "xxxxxx",
            "port": xxxxxx,
            "users": [
              {
                "id": "uid",
                "flow": "xtls-rprx-direct",
                "encryption": "none",
                "level": 0
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "tcp",
        "security": "xtls",
        "xtlsSettings": { "serverName": "xxxx" }
      }
    },
    {
      "protocol": "freedom",
      "settings": {},
      "tag": "direct"
    }
  ],
  "dns": {
    "servers": [
      "114.114.114.114",
      {
        "address": "1.1.1.1",
        "port": 53,
        "domains": ["geosite:geolocation-!cn"]
      }
    ]
  },
  "routing": {
    "domainStrategy": "IPOnDemand",
    "rules": [
      {
        "type": "field",
        "outboundTag": "direct",
        "domain": ["geosite:cn"]
      },
      {
        "type": "field",
        "outboundTag": "direct",
        "ip": ["geoip:cn", "geoip:private"]
      }
    ]
  }
}

版本号均为 Xray 1.6.0

截屏2022-11-10 下午9 00 23

应该是一样的问题

https://github.com/XTLS/Xray-core/issues/1086

log

2022/11/10 21:01:47 [Warning] [3276969941] app/proxyman/inbound: connection ends > proxy/http: connection ends > proxy/http: failed to write response > write tcp 127.0.0.1:1080->127.0.0.1:56936: write: broken pipe
2022/11/10 21:01:47 [Warning] [340069173] app/proxyman/inbound: connection ends > proxy/http: connection ends > proxy/http: failed to write response > write tcp 127.0.0.1:1080->127.0.0.1:56928: write: broken pipe
2022/11/10 21:01:47 [Warning] [140224002] app/proxyman/inbound: connection ends > proxy/http: connection ends > proxy/http: failed to write response > write tcp 127.0.0.1:1080->127.0.0.1:56937: write: broken pipe
2022/11/10 21:01:47 [Warning] [3517137836] app/proxyman/inbound: connection ends > proxy/http: connection ends > proxy/http: failed to write response > write tcp 127.0.0.1:1080->127.0.0.1:56927: write: broken pipe
2022/11/10 21:01:47 [Warning] [1677904192] app/proxyman/inbound: connection ends > proxy/http: connection ends > proxy/http: failed to write response > write tcp 127.0.0.1:1080->127.0.0.1:56943: write: broken pipe
2022/11/10 21:01:47 [Warning] [524123564] app/proxyman/inbound: connection ends > proxy/http: connection ends > proxy/http: failed to write response > write tcp 127.0.0.1:1080->127.0.0.1:56950: write: broken pipe
2022/11/10 21:01:47 [Warning] [3808278135] app/proxyman/inbound: connection ends > proxy/http: connection ends > proxy/http: failed to write response > write tcp 127.0.0.1:1080->127.0.0.1:56907: write: protocol wrong type for socket
2022/11/10 21:01:47 [Warning] [1887262109] app/proxyman/inbound: connection ends > proxy/http: connection ends > proxy/http: failed to write response > write tcp 127.0.0.1:1080->127.0.0.1:56942: write: broken pipe
2022/11/10 21:01:47 [Warning] [3551598817] app/proxyman/inbound: connection ends > proxy/http: connection ends > proxy/http: failed to write response > write tcp 127.0.0.1:1080->127.0.0.1:56938: write: broken pipe
2022/11/10 21:01:47 127.0.0.1:57092 accepted http://r3.o.lencr.org/MFgwVqADAgEAME8wTTBLMAkGBSsOAwIaBQAEFEjayaD7K9MtT%2FDeaNL1Z7c1%2BbPEBBQULrMXt1hWy65QCUDmH6%2BdixTCxgISA9VOFUOK%2BHojarw2q2WqmfIf
2022/11/10 21:01:47 127.0.0.1:57094 accepted http://r3.o.lencr.org/MFgwVqADAgEAME8wTTBLMAkGBSsOAwIaBQAEFEjayaD7K9MtT%2FDeaNL1Z7c1%2BbPEBBQULrMXt1hWy65QCUDmH6%2BdixTCxgISA9VOFUOK%2BHojarw2q2WqmfIf
2022/11/10 21:01:47 127.0.0.1:57095 accepted http://r3.o.lencr.org/MFgwVqADAgEAME8wTTBLMAkGBSsOAwIaBQAEFEjayaD7K9MtT%2FDeaNL1Z7c1%2BbPEBBQULrMXt1hWy65QCUDmH6%2BdixTCxgISA9VOFUOK%2BHojarw2q2WqmfIf
2022/11/10 21:01:47 127.0.0.1:57096 accepted http://r3.o.lencr.org/MFgwVqADAgEAME8wTTBLMAkGBSsOAwIaBQAEFEjayaD7K9MtT%2FDeaNL1Z7c1%2BbPEBBQULrMXt1hWy65QCUDmH6%2BdixTCxgISA9VOFUOK%2BHojarw2q2WqmfIf
2022/11/10 21:01:47 [Warning] [3465481982] app/proxyman/inbound: connection ends > proxy/http: connection ends > proxy/http: failed to write response > write tcp 127.0.0.1:1080->127.0.0.1:56790: write: broken pipe

代理能用,但是非常影响电脑使用(性能卡顿)

截屏2022-11-10 下午9 04 12

0jinxing avatar Nov 10 '22 13:11 0jinxing

开启 2 分钟 xray 线程数 直接飙到 400+ 客户端、服务端 都是用 xray-core,

0jinxing avatar Nov 10 '22 13:11 0jinxing

救救弟弟,弟弟只是想上网 之前都是正常的,最近几天就出问题,能用但是非常卡

0jinxing avatar Nov 10 '22 13:11 0jinxing

估计配置文件哪儿出错了吧,整个第三方客户端试试啊。 不用手动写客户端配置的话,那就主要排除服务端配置的错误就行了。

lhbdhr avatar Nov 10 '22 13:11 lhbdhr

而且报错的是 inbound ,应该是客户端 inbound部分写错了吧。 我推荐你把 客户端 http代理删掉,只留下socks试试

lhbdhr avatar Nov 10 '22 13:11 lhbdhr

配置 我直接 copy example 部分的

0jinxing avatar Nov 10 '22 13:11 0jinxing

https://github.com/XTLS/Xray-core/issues/1086

我和这位老哥的 问题 2模2样

0jinxing avatar Nov 10 '22 13:11 0jinxing

2022/11/10 21:53:04 127.0.0.1:52394 accepted http://r3.o.lencr.org/MFgwVqADAgEAME8wTTBLMAkGBSsOAwIaBQAEFEjayaD7K9MtT%2FDeaNL1Z7c1%2BbPEBBQULrMXt1hWy65QCUDmH6%2BdixTCxgISA9VOFUOK%2BHojarw2q2WqmfIf

我的证书用的是 let's encrypt 的。貌似报错和证书有点关系

0jinxing avatar Nov 10 '22 13:11 0jinxing

#1086

我和这位老哥的 问题 2模2样

只是报错提示一样而已,人家用的 Qv2ray,那软件作者跑路了。很久没更新,和xray内核匹配不上了。所以报错。 可能你看的示例配置也过时了?

lhbdhr avatar Nov 10 '22 13:11 lhbdhr

https://github.com/XTLS/Xray-examples/tree/main/VLESS-TCP-XTLS-WHATEVER

推荐示例配置里的 终极模式 vless+torjan 都可以用。 还有回落伪装。 我简化了一下server的配置,你可以拿去试试。 简单还好用。

{
  "log": {
    "loglevel": "warning",
    "access": "/var/log/xray/access.log",
    "error": "/var/log/xray/error.log",
    "dnsLog": true
  },
  "inbounds": [
    {
      "port": 443,
      "protocol": "vless",
      "settings": {
        "clients": [
          {
            "id": "xxx", // 填写你的 UUID
            "flow": "xtls-rprx-direct",
            "level": 0,
            "email": "[email protected]"
          }
        ],
        "decryption": "none",
        "fallbacks": [
          {
            "dest": 1310, // 默认回落到 Xray 的 Trojan 协议
            "xver": 1
          }
        ]
      },
      "streamSettings": {
        "network": "tcp",
        "security": "xtls",
        "xtlsSettings": {
          "alpn": ["http/1.1"],
          "certificates": [
            {
              "certificateFile": "/usr/local/etc/xray/server.cer", // 换成你的证书,绝对路径
              "keyFile": "/usr/local/etc/xray/server.key" // 换成你的私钥,绝对路径
            }
          ]
        }
      }
    },
    {
      "port": 1310,
      "listen": "127.0.0.1",
      "protocol": "trojan",
      "settings": {
        "clients": [
          {
            "password": "xxxxxxxxxxx", // 填写你的密码
            "level": 0,
            "email": "[email protected]"
          }
        ],
        "fallbacks": [
          {
            "dest": 80 // 或者回落到其它也防探测的代理
          }
        ]
      },
      "streamSettings": {
        "network": "tcp",
        "security": "none",
        "tcpSettings": {
          "acceptProxyProtocol": true
        }
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom"
    }
  ]
}

lhbdhr avatar Nov 10 '22 14:11 lhbdhr

https://github.com/XTLS/Xray-examples/tree/main/VLESS-TCP-XTLS-WHATEVER

推荐示例配置里的 终极模式 vless+torjan 都可以用。 还有回落伪装。 我简化了一下server的配置,你可以拿去试试。 简单还好用。

{
  "log": {
    "loglevel": "warning",
    "access": "/var/log/xray/access.log",
    "error": "/var/log/xray/error.log",
    "dnsLog": true
  },
  "inbounds": [
    {
      "port": 443,
      "protocol": "vless",
      "settings": {
        "clients": [
          {
            "id": "xxx", // 填写你的 UUID
            "flow": "xtls-rprx-direct",
            "level": 0,
            "email": "[email protected]"
          }
        ],
        "decryption": "none",
        "fallbacks": [
          {
            "dest": 1310, // 默认回落到 Xray 的 Trojan 协议
            "xver": 1
          }
        ]
      },
      "streamSettings": {
        "network": "tcp",
        "security": "xtls",
        "xtlsSettings": {
          "alpn": ["http/1.1"],
          "certificates": [
            {
              "certificateFile": "/usr/local/etc/xray/server.cer", // 换成你的证书,绝对路径
              "keyFile": "/usr/local/etc/xray/server.key" // 换成你的私钥,绝对路径
            }
          ]
        }
      }
    },
    {
      "port": 1310,
      "listen": "127.0.0.1",
      "protocol": "trojan",
      "settings": {
        "clients": [
          {
            "password": "xxxxxxxxxxx", // 填写你的密码
            "level": 0,
            "email": "[email protected]"
          }
        ],
        "fallbacks": [
          {
            "dest": 80 // 或者回落到其它也防探测的代理
          }
        ]
      },
      "streamSettings": {
        "network": "tcp",
        "security": "none",
        "tcpSettings": {
          "acceptProxyProtocol": true
        }
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom"
    }
  ]
}

不行🙅,还是一样的问题

0jinxing avatar Nov 10 '22 14:11 0jinxing

放弃了,风扇呼呼转。

0jinxing avatar Nov 10 '22 15:11 0jinxing

Clash.Meta 不错

qist avatar Nov 11 '22 01:11 qist

最新正式版是1.6.1,你C/S都升级下试试

WalkerGloom avatar Nov 11 '22 02:11 WalkerGloom

你的服务器配置文件,路由写了blockedblock,但是没有写blakhole出站协议 客户端配置也有问题,两个入栈没有开启嗅探 我改了改你的配置,可以试试 服务器:

{
  "log": {
    "loglevel": "warning"
  },
  "inbounds": [
    {
      "port": 8080,
      "protocol": "vless",
      "settings": {
        "clients": [
          {
            "id": "__UUID__",
            "flow": "xtls-rprx-direct"
          }
        ],
        "decryption": "none",
        "fallbacks": [
          {
            "dest": 10443,
            "xver": 1
          }
        ]
      },
      "sniffing": {
        "enabled": true,
        "destOverride": ["http", "tls"]
      },
      "streamSettings": {
        "network": "tcp",
        "security": "xtls",
        "xtlsSettings": {
          "certificates": [
            {
              "certificateFile": "/etc/ssl/xray/cert.pem",
              "keyFile": "/etc/ssl/xray/privkey.key"
            }
          ]
        }
      }
    }
  ],
  "outbounds": [
    {
      "tag": "direct",
      "protocol": "freedom"
    },
    {
      "tag": "block",
      "protocol": "blackhole"
    }
  ],
  "routing": {
    "domainStrategy": "IPOnDemand",
    "rules": [
      {
        "type": "field",
        "protocol": ["bittorrent"],
        "outboundTag": "block"
      },
      {
        "type": "field",
        "domains": ["geosite:cn"],
        "outboundTag": "block"
      },
      {
        "type": "field",
        "ip": ["geoip:cn"],
        "outboundTag": "block"
      }
    ]
  }
}

客户端

{
  "log": {
    "loglevel": "warning"
  },
  "inbounds": [
    {
      "port": 1081,
      "listen": "0.0.0.0",
      "protocol": "socks",
      "settings": { "udp": true },
      "sniffing": {
        "destOverride": ["http", "tls"],
        "enabled": true
      }
    },
    {
      "port": 1080,
      "listen": "0.0.0.0",
      "protocol": "http",
      "sniffing": {
        "destOverride": ["http", "tls"],
        "enabled": true
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "vless",
      "settings": {
        "vnext": [
          {
            "address": "__VPSIP__",
            "port": 8080,
            "users": [
              {
                "id": "__UUID__",
                "flow": "xtls-rprx-direct",
                "encryption": "none"
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "tcp",
        "security": "xtls",
        "xtlsSettings": { "serverName": "__SERVERNAME__" }
      }
    },
    {
      "tag": "direct",
      "protocol": "freedom"
    }
  ],
  "dns": {
    "servers": [
      "114.114.114.114",
      {
        "address": "1.1.1.1",
        "port": 53,
        "domains": ["geosite:geolocation-!cn"]
      }
    ]
  },
  "routing": {
    "domainStrategy": "IPOnDemand",
    "rules": [
      {
        "type": "field",
        "domains": ["geosite:cn"],
        "outboundTag": "direct"
      },
      {
        "type": "field",
        "ip": ["geoip:cn", "geoip:private"],
        "outboundTag": "direct"
      }
    ]
  }
}

azzvx avatar Nov 11 '22 03:11 azzvx

如果对手动写config.json不是特别有把握的话,可以在手机端(如V2rayNG)配置好,然后“导出完整配置至剪切板”。

Maoyeedy avatar Nov 11 '22 04:11 Maoyeedy

好的谢谢 大家

0jinxing avatar Nov 12 '22 02:11 0jinxing