For a client software running on Windows, I need a socks5 proxy on the NetBSD server. For I didn't find anything appropriate in /usr/pkgsrc, I built the "Nylon" daemon on my own. I know that program from an FreeBSD box I had before. It runs perfectly, binds like told to port 1080 - but the client software is unable to connect through it.

When I do a telnet <hostname> 1080 I get a connect, and after typing some garbage Nylon complaints about that garbage. So far, so good. But there is no response from Nylon at all when the client software is run.

Any hint on how to debug this situation? Or any hint about some socks5 proxy server being "hidden" in NetBSD's /usr/pkgsrc?

  • rvp replied to this.

    Blackavar This nylon with the patch below worked just fine:

    diff -urN nylon-master.orig/src/socks4.c nylon-master/src/socks4.c
    --- nylon-master.orig/src/socks4.c	2017-01-22 10:57:44.000000000 +0000
    +++ nylon-master/src/socks4.c	2021-01-25 10:34:14.129119066 +0000
    @@ -139,12 +139,14 @@
     		return (-1);
     
     	if ((ai = conn->bind_ai) != NULL) {
    +#if 0
             if (conn->bind_if_name != NULL) {
                 if (setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, conn->bind_if_name, IFNAMSIZ-1) == -1) {
                     warnv(0, "bind device()");
                     return (-1);
                 }
             }
    +#endif
     
     		if (bind(sock, ai->ai_addr, ai->ai_addrlen) == -1) {
     			warnv(0, "bind()");
    diff -urN nylon-master.orig/src/socks5.c nylon-master/src/socks5.c
    --- nylon-master.orig/src/socks5.c	2017-01-22 10:57:44.000000000 +0000
    +++ nylon-master/src/socks5.c	2021-01-25 10:34:02.248187253 +0000
    @@ -184,18 +184,21 @@
     		return (-1);
     	}
     
    -	if ((ai = conn->bind_ai) != NULL)
    +	if ((ai = conn->bind_ai) != NULL) {
    +#if 0
             if (conn->bind_if_name != NULL) {
                 if (setsockopt(remsock, SOL_SOCKET, SO_BINDTODEVICE, conn->bind_if_name, IFNAMSIZ-1) == -1) {
                     warnv(0, "bind device()");
                     return (-1);
                 }
             }
    +#endif
     
     		if (bind(remsock, ai->ai_addr, ai->ai_addrlen) == -1) {
     			warnv(0, "bind()");
     			return (-1);
     		}
    +	}
     
     	if (connect(remsock, (struct sockaddr *)rem_in, sizeof(*rem_in)) == -1) {
     		warnv(0, "connect()");
    • Jay likes this.

    Thanks so much! Ten minutes ago I solved the problem. The software running on the Windows clients showed the proxy's address correctly, but internally it still had the old server's IP address. Deleting it's entry in the registry and re-entering the data solved the problem.

    Sorry for disturbing here with a finally non-BSD problem.