heiher/hev-socks5-tunnel

iOS is working perfectly, macOS traffic is not going

Closed this issue · 6 comments

tozik commented

Config is

        tunnel:
         # Interface name
          name: tun1
          mtu: 9000

        socks5:
          # Socks5 server port
          port: \(port)
          # Socks5 server address (ipv4/ipv6)
          address: \(address)
          # Socks5 UDP relay mode (tcp|udp)
          udp: 'udp'
          # Socks5 server username
          username: '\(username)'
          # Socks5 server password
          password: '\(password)'

        misc:
          task-stack-size: 20480
          connect-timeout: 5000
          read-write-timeout: 60000
          log-file: stderr
          log-level: debug
          limit-nofile: 65535
        """
setTunnelNetworkSettings(tunnelNetworkSettings)

with

 let newSettings = NEPacketTunnelNetworkSettings(tunnelRemoteAddress: "192.168.111.10")
        newSettings.ipv4Settings = NEIPv4Settings(addresses: ["192.168.111.111"], subnetMasks: ["255.255.255.0"])

        newSettings.ipv4Settings?.includedRoutes = [NEIPv4Route.`default`()]
        newSettings.proxySettings = nil
        newSettings.dnsSettings = NEDNSSettings(servers: ["8.8.8.8","8.8.4.4"])
        newSettings.mtu = 9000

But traffic is not going, with same way iOS working

without setTunnelNetworkSettings traffic going not through socks server
could you give some advise please?

tozik commented

logs is not writing
if add
log-file: '/Users/user/Library/Group Containers/folder/file.log'

tozik commented

possibly trouble in the call

let result = HevSocks5Tunnel.hev_socks5_tunnel_main(String(subpath), tunFd)
cause result -1

heiher commented

logs is not writing

no permission?

cause result -1

The hev_socks5_tunnel_main returns -1, indicating a failure in parsing the configuration.

tozik commented

logs is not writing

no permission?

cause result -1

The hev_socks5_tunnel_main returns -1, indicating a failure in parsing the configuration.

Yep, did some changes in path formating and all is ok.
A bit strange, but great than not much time.

Thanks

could you please show me your change ?
this is my config not working in macos but worked in ios

        tunnel:
          name: tun0
          mtu: 9000
        socks5:
          port: \(port)
          address: 127.0.0.1
          udp: 'tcp'
        misc:
          task-stack-size: 20480
          connect-timeout: 5000
          read-write-timeout: 60000
          log-file: stderr
          log-level: debug
          limit-nofile: 65535

            let newSettings = NEPacketTunnelNetworkSettings(tunnelRemoteAddress: "192.168.111.10")
                   newSettings.ipv4Settings = NEIPv4Settings(addresses: ["192.168.111.111"], subnetMasks: ["255.255.255.0"])

                   newSettings.ipv4Settings?.includedRoutes = [NEIPv4Route.`default`()]
                   newSettings.proxySettings = nil
                   newSettings.dnsSettings = NEDNSSettings(servers: ["8.8.8.8","8.8.4.4"])
                   newSettings.mtu = 9000
tozik commented

@H-Khoujani was removed name, and there is some changes in settings.