Simply doesn't work
Listening port drops connections. Literally nothing is happening. Debug log shows nothing. An nginx worker exists with signal 8.
2022/12/23 22:40:35 [debug] 57526#102466: accept on 10.10.0.1:8080, ready: 1
2022/12/23 22:40:35 [debug] 57526#102466: posix_memalign: 0000000800DD5000:256 @16
2022/12/23 22:40:35 [debug] 57526#102466: *15 accept: 10.10.0.1:58234 fd:3
2022/12/23 22:40:35 [debug] 57526#102466: posix_memalign: 0000000800DD5100:256 @16
2022/12/23 22:40:35 [info] 57526#102466: *15 client 10.10.0.1:58234 connected to 10.10.0.1:8080
2022/12/23 22:40:35 [debug] 57526#102466: *15 posix_memalign: 0000000800DD5200:256 @16
2022/12/23 22:40:35 [debug] 57526#102466: *15 malloc: 000000080147C140:272
2022/12/23 22:40:35 [debug] 57526#102466: *15 generic phase: 0
2022/12/23 22:40:35 [debug] 57526#102466: *15 generic phase: 1
2022/12/23 22:40:35 [debug] 57526#102466: *15 generic phase: 2
2022/12/23 22:40:35 [debug] 57526#102466: *15 generic phase: 3
2022/12/23 22:40:35 [debug] 57526#102466: *15 generic phase: 4
2022/12/23 22:40:35 [debug] 57526#102466: *15 tcp_nodelay
2022/12/23 22:40:35 [debug] 57526#102466: *15 posix_memalign: 0000000800DD5300:256 @16
2022/12/23 22:40:35 [debug] 57526#102466: *15 posix_memalign: 0000000800DD5400:256 @16
2022/12/23 22:40:35 [debug] 57526#102466: *15 recv: eof:0, avail:0, err:0
2022/12/23 22:40:35 [debug] 57526#102466: *15 kevent set event: 3: ft:-1 fl:0025
2022/12/23 22:40:35 [debug] 57526#102466: *15 recv: eof:0, avail:5, err:0
2022/12/23 22:40:35 [debug] 57526#102466: *15 recv: fd:3 5 of 128
2022/12/23 22:40:35 [debug] 57526#102466: *15 send: fd:3 2 of 2
2022/12/23 22:40:35 [debug] 57526#102466: *15 recv: eof:0, avail:13, err:0
2022/12/23 22:40:35 [debug] 57526#102466: *15 recv: fd:3 13 of 128
2022/12/23 22:40:35 [debug] 57528#102466: kevent set event: 11: ft:-1 fl:0005
2022/12/23 22:40:35 [debug] 57528#102466: kevent set event: 12: ft:-1 fl:0005
2022/12/23 22:40:35 [debug] 57528#102466: kevent set event: 13: ft:-1 fl:0005
2022/12/23 22:40:35 [debug] 57528#102466: kevent set event: 14: ft:-1 fl:0005
2022/12/23 22:40:35 [debug] 57528#102466: kevent set event: 15: ft:-1 fl:0005
==> ngx.error.log <==
2022/12/23 22:40:35 [alert] 57408#101792: worker process 57526 exited on signal 8
log_format socks5 'socks: $socks_connect_addr $socks_name $socks_passwd';
server {
listen 10.10.0.1:8080;
socks;
socks_proxy_bind [external IPv4];
socks_user_passwd test1 test2;
access_log ngx_socks_access.log socks5;
}
testing with:
# curl -v --socks5 test1:[email protected]:8080 ifconfig.me
* Trying 10.10.0.1:8080...
* connection to proxy closed
* Closing connection 0
curl: (97) connection to proxy closed
nginx version: nginx/1.23.3
Compiles fine. Stream is enabled (and works).
Works if curl provides user/password AND the server block is defined WITHOUT socks_user_passwd.
curl -v --socks5 test1:[email protected]:8080 ifconfig.me
* Trying 10.10.0.1:8080...
* SOCKS5 connect to IPv4 34.160.111.145:80 (locally resolved)
* SOCKS5 request granted.
* Connected to (nil) (10.10.0.1) port 8080 (#0)
> GET / HTTP/1.1
> Host: ifconfig.me
> User-Agent: curl/7.86.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< access-control-allow-origin: *
< content-type: text/plain; charset=utf-8
< content-length: 13
< date: Fri, 23 Dec 2022 21:59:50 GMT
< x-envoy-upstream-service-time: 1
< strict-transport-security: max-age=2592000; includeSubDomains
< server: istio-envoy
< Via: 1.1 google
<
* Connection #0 to host (nil) left intact
[External IP]
However, seems that 1 try is around 5-6 is still being dropped anyway (for seemingly no reason).
Apart from the user/password bug and sudden drops sometimes, good job. This is an incredibly helpful functionality.
@QuantumDisposition Hello, sorry for the slow response, I have fixed this https://github.com/attenuation/ngx_stream_socks_module/commit/bf6c646b22c9513d8d42f1cd17826fd33853198b, please try it.