Proxy 如何通过Dante socks代理配置SOCKS4身份验证

Proxy 如何通过Dante socks代理配置SOCKS4身份验证,proxy,socks,dante,Proxy,Socks,Dante,我能够使用Dante socks代理配置socks4、socks5和socks5的身份验证,但我不知道如何配置socks4的身份验证。我知道socks_v4代理仅支持用户ID(而不支持密码) 我的danted.conf文件如下所示: logoutput: syslog internal: eth0 port =1081 external: eth0 user.privileged: root user.unprivileged: nobody socksmethod: username clie

我能够使用Dante socks代理配置socks4、socks5和socks5的身份验证,但我不知道如何配置socks4的身份验证。我知道socks_v4代理仅支持用户ID(而不支持密码)

我的danted.conf文件如下所示:

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
}
我发现了错误

#username and password
curl -x socks4://user1:user1@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.

#just username
curl -x socks4://user1@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.

#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.
SOCKS协议版本4不支持身份验证方法“username”,只有SOCKS v5支持。当您将Dante配置为需要来自所有客户端的“方法:用户名”时,实际上是在阻止所有SOCKS v4客户端

配置的其他问题是SOCKS v4不支持UDP,因此 袜子规则中的设置也没有多大意义

您应该将Dante配置为日志,并查看Dante日志。由于是Dante阻止了连接,因此更容易从Dante日志中看出原因是什么。Dante可能还会在其日志文件中报告您的danted.conf的一些问题