I was able to configure socks4,socks5 and socks5 with authentication using Dante socks proxy, but I have no ideas how to configure socks4 with authentication. I know socks_v4 proxy supports userId only (not password).
My danted.conf file looks like below:
logoutput: syslog
internal: eth0 port =1081
external: eth0
user.privileged: root
user.unprivileged: nobody
socksmethod: username
clientmethod: none
client pass {
from: 0.0.0.0/0
to: 0.0.0.0/0
log: error
}
socks pass {
from: 0.0.0.0/0
to: 0.0.0.0/0
command: bind connect udpassociate
protocol: tcp udp
proxyprotocol: socks_v4
log: error
socksmethod:username
}
I got the errors
#username and password
curl -x socks4://user1:[email protected]:1081 http://google.com
curl: (7) Can't complete SOCKS4 connection to 142.250.73.206:80. (91), request rejected or failed.
#just username
curl -x socks4://[email protected]:1081 http://google.com
curl: (7) Can't complete SOCKS4 connection to 142.250.73.206:80. (91), request rejected or failed.
#no auth
curl -x socks4://x.2xx.1xx.x:1081 http://google.com
curl: (7) Can't complete SOCKS4 connection to 142.250.73.206:80. (91), request rejected or failed.
The authentication method "username" is not supported by version 4 of the SOCKS protocol, only by SOCKS v5. When you configure Dante to require "method: username" from all clients, you are in effect blocking all SOCKS v4 clients.
Other problems with your configuration is that SOCKS v4 does not support UDP, so the settings in your socks-rule does not make much sense either.
You should configure Dante to log, and look at the Dante logs. Since it is Dante that is blocking the connection, it will be easier to see in the Dante logs what the reason is. Dante would probably also report some of the problems with your danted.conf in it's logfile.