heiher / hev-socks5-tunnel

A high-performance tun2socks for Linux/Android/FreeBSD/macOS/iOS/WSL2 (IPv4/IPv6/TCP/UDP)
MIT License
911 stars 164 forks source link

v2ray未能成功转发 #168

Closed dhp5 closed 1 month ago

dhp5 commented 1 month ago

我的Tun2socks连接成功了。但是转发到v2ray服务器。解析出来的 全是EOF。请问这是什么问题呀?这是我服务端解析到的日志

[Info] common/mux: failed to read metadata > io: read/write on closed pipe [Info] common/mux: failed to read metadata > io: read/write on closed pipe [Info] [3411192088] transport/internet/udp: failed to handle UDP input > EOF [Info] common/mux: failed to read metadata > io: read/write on closed pipe [Info] [4159722323] transport/internet/udp: failed to handle UDP input > EOF [Info] [1537859122] transport/internet/udp: failed to handle UDP input > EOF

这是我的配置:

       tunnel:
            mtu: 8500

        socks5:
            port: 10808
            address: 127.0.0.1
            udp: 'udp'

        misc:
            task-stack-size: 81920
            connect-timeout: 5000
            read-write-timeout: 60000
            log-file: stderr
            log-level: debug
            limit-nofile: 65535
func getNetworkSettings(with mtu: Int) -> NEPacketTunnelNetworkSettings {
        let settings = NEPacketTunnelNetworkSettings(tunnelRemoteAddress: "254.1.1.1")
        settings.mtu = NSNumber(integerLiteral: mtu)
        settings.ipv4Settings = {
            let settings = NEIPv4Settings(addresses: ["198.18.0.1"], subnetMasks: ["255.255.255.0"])
            settings.includedRoutes = [NEIPv4Route.default()]
            return settings
        }()
        settings.ipv6Settings = {
            let settings = NEIPv6Settings(addresses: ["da26:2626::1"], networkPrefixLengths: [126])
            settings.includedRoutes = [NEIPv6Route.default()]
            return settings
        }()

        settings.dnsSettings = NEDNSSettings(servers: ["1.1.1.1", "8.8.8.8"])
        return settings
    }
dhp5 commented 1 month ago

V2ray的日志


[Warning] failed to handler mux client connection > proxy/shadowsocks: failed to find an available destination > common/retry: [fail to protect] > common/retry: all retry attempts failed
[Info] common/mux: failed to read metadata > io: read/write on closed pipe
[Info] [1352113521] transport/internet/udp: failed to handle UDP input > EOF
[Warning] failed to handler mux client connection > proxy/shadowsocks: failed to find an available destination > common/retry: [fail to protect] > common/retry: all retry attempts failed
[Info] common/mux: failed to read metadata > io: read/write on closed pipe
[Warning] failed to handler mux client connection > proxy/shadowsocks: failed to find an available destination > common/retry: [fail to protect] > common/retry: all retry attempts failed
[Info] common/mux: failed to read metadata > io: read/write on closed pipe
[Info] [2274812711] transport/internet/udp: failed to handle UDP input > EOF
[Info] [2538165771] transport/internet/udp: failed to handle UDP input > EOF
[Info] [292530728] proxy/socks: client UDP connection from udp:127.0.0.1:51778
[Info] transport/internet/udp: establishing new connection for udp:8.8.8.8:53
[Warning] [292530728] app/dispatcher: default route for udp:8.8.8.8:53
[Info] [292530728] common/mux: dispatching request to udp:8.8.8.8:53
udp:127.0.0.1:51778 accepted udp:8.8.8.8:53 [proxy]
``
dhp5 commented 1 month ago

这是我的inbounds,请大佬有时间的话帮我看一下,谢谢

"inbounds": [
    {
      "listen": "127.0.0.1",
      "port": 10808,
      "protocol": "socks",
      "settings": {
        "auth": "noauth",
        "udp": true,
        "userLevel": 8
      },
      "sniffing": {
        "destOverride": [
          "http",
          "tls"
        ],
        "enabled": true
      },
      "tag": "socks"
    },
    {
      "listen": "127.0.0.1",
      "port": 10809,
      "protocol": "http",
      "settings": {
        "userLevel": 8
      },
      "tag": "http"
    }
  ]
heiher commented 1 month ago
[Info] [292530728] proxy/socks: client UDP connection from udp:127.0.0.1:51778
[Info] transport/internet/udp: establishing new connection for udp:8.8.8.8:53
[Warning] [292530728] app/dispatcher: default route for udp:8.8.8.8:53
[Info] [292530728] common/mux: dispatching request to udp:8.8.8.8:53
udp:127.0.0.1:51778 accepted udp:8.8.8.8:53 [proxy]

从这一段日志看,udp assocation似乎正常。域名没有解析成功吗?

dhp5 commented 1 month ago
[Info] [292530728] proxy/socks: client UDP connection from udp:127.0.0.1:51778
[Info] transport/internet/udp: establishing new connection for udp:8.8.8.8:53
[Warning] [292530728] app/dispatcher: default route for udp:8.8.8.8:53
[Info] [292530728] common/mux: dispatching request to udp:8.8.8.8:53
udp:127.0.0.1:51778 accepted udp:8.8.8.8:53 [proxy]

从这一段日志看,udp关联似乎正常。域名没有解析成功吗?

像是没有成功,因为我后台解析到的都是EOF。我有办法获取我转发出去的具体数据吗?我比对一下后台数据的解析

dhp5 commented 1 month ago
[Info] [292530728] proxy/socks: client UDP connection from udp:127.0.0.1:51778
[Info] transport/internet/udp: establishing new connection for udp:8.8.8.8:53
[Warning] [292530728] app/dispatcher: default route for udp:8.8.8.8:53
[Info] [292530728] common/mux: dispatching request to udp:8.8.8.8:53
udp:127.0.0.1:51778 accepted udp:8.8.8.8:53 [proxy]

从这一段日志看,udp关联似乎正常。域名没有解析成功吗?

这个是最新的日志。能帮忙看看大概是啥原因么?

2024/09/27 03:14:58 fdConn fail to protect, Close Fd: 19
[Info] transport/internet/tcp: dialing TCP to tcp:47.76.156.13:8080
2024/09/27 03:14:58 fdConn fail to protect, Close Fd: 17
2024/09/27 03:14:58 fdConn fail to protect, Close Fd: 17
2024/09/27 03:14:58 fdConn fail to protect, Close Fd: 18
2024/09/27 03:14:58 fdConn fail to protect, Close Fd: 18
2024/09/27 03:14:58 fdConn fail to protect, Close Fd: 20
2024/09/27 03:14:58 fdConn fail to protect, Close Fd: 20
[Warning] failed to handler mux client connection > proxy/shadowsocks: failed to find an available destination > common/retry: [fail to protect] > common/retry: all retry attempts failed
[Info] common/mux: failed to read metadata > io: read/write on closed pipe
[Warning] failed to handler mux client connection > proxy/shadowsocks: failed to find an available destination > common/retry: [fail to protect] > common/retry: all retry attempts failed
[Info] common/mux: failed to read metadata > io: read/write on closed pipe
[Warning] failed to handler mux client connection > proxy/shadowsocks: failed to find an available destination > common/retry: [fail to protect] > common/retry: all retry attempts failed
[Info] common/mux: failed to read metadata > io: read/write on closed pipe
[Warning] failed to handler mux client connection > proxy/shadowsocks: failed to find an available destination > common/retry: [fail to protect] > common/retry: all retry attempts failed
[Info] common/mux: failed to read metadata > io: read/write on closed pipe
[Info] [3639011003] transport/internet/udp: failed to handle UDP input > EOF
[Info] [395010964] transport/internet/udp: failed to handle UDP input > EOF
[Info] [283858217] transport/internet/udp: failed to handle UDP input > EOF
[Info] [3779060666] transport/internet/udp: failed to handle UDP input > EOF
[Info] [603261624] proxy/socks: client UDP connection from udp:127.0.0.1:55258
[Info] transport/internet/udp: establishing new connection for udp:1.1.1.1:53
udp:127.0.0.1:54775 accepted udp:1.1.1.1:53 [proxy]
udp:127.0.0.1:55258 accepted udp:1.1.1.1:53 [proxy]
[Info] [1785054112] proxy/socks: client UDP connection from udp:127.0.0.1:54775
[Info] transport/internet/udp: establishing new connection for udp:1.1.1.1:53
[Warning] [603261624] app/dispatcher: default route for udp:1.1.1.1:53
[Warning] [1785054112] app/dispatcher: default route for udp:1.1.1.1:53
[Info] [1785054112] common/mux: dispatching request to udp:1.1.1.1:53
[Info] [603261624] common/mux: dispatching request to udp:1.1.1.1:53
[Info] transport/internet/tcp: dialing TCP to tcp:47.76.156.13:8080
2024/09/27 03:14:59 fdConn fail to protect, Close Fd: 19
[Info] transport/internet/tcp: dialing TCP to tcp:47.76.156.13:8080