moproxy icon indicating copy to clipboard operation
moproxy copied to clipboard

error on hanle client: Neither a NATed or SOCKSv5 connection

Open Baltazar500 opened this issue 1 year ago • 3 comments

Hi,

When redirecting traffic through iptables (using DNAT or REDIRECT), moproxy gives the message

[INFO] error on handle client: Neither a NATed or SOCKSv5 connection

However, it successfully passes SOCKS5 curl requests. In the same situation, transocks redirects traffic without issues. What could be the problem? The version I'm using is 0.3.9 or 0.3.12. The maximum version I can use is 0.3.12; versions higher on android 5.1 than this give an error

CANNOT LINK EXECUTABLE: cannot locate symbol "__register_atfork" referenced by "/data/bin/moproxy_0.4.1_linux_aarch64_android.bin"...

Baltazar500 avatar Jul 29 '24 17:07 Baltazar500

Hi there,

So you use iptables on Android? Is transocks also use iptables with DNAT/REDIRECT?

I haven't test it on Android and not sure what may cause it.

sorz avatar Aug 08 '24 06:08 sorz

So you use iptables on Android? Is transocks also use iptables with DNAT/REDIRECT?

Yes, the redirect via transocks works without problems. moproxy in the same mode receives "error on handle client: Neither a NATed or SOCKSv5 connection" :/

I haven't test it on Android and not sure what may cause it.

ОК :( ...

Baltazar500 avatar Aug 08 '24 19:08 Baltazar500

I'm getting the same message on a MikroTik (arm64, DNAT) For some reason it enters the socks5 logic

async fn accept_socks5(client: &mut TcpStream) -> io::Result<Destination> {
    // Not a NATed connection, treated as SOCKSv5
    // Parse version
    // TODO: add timeout
    // TODO: use buffered reader
    let ver = client.read_u8().await?;
    if ver != 0x05 {
        return error_invalid_input("Neither a NATed or SOCKSv5 connection");
    }

tsundokul avatar Nov 15 '24 19:11 tsundokul