proxy - 如何通过 Dante socks 代理配置 SOCKS4 身份验证
问题描述
我能够使用 Dante socks 代理配置 socks4、socks5 和 socks5 的身份验证,但我不知道如何配置 socks4 的身份验证。我知道 socks_v4 代理仅支持 userId(不是密码)。
我的 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 不支持身份验证方法“用户名”,仅 SOCKS v5 支持。当您将 Dante 配置为要求所有客户端的“方法:用户名”时,您实际上阻止了所有 SOCKS v4 客户端。
您的配置的其他问题是 SOCKS v4 不支持 UDP,因此您的 socks-rule 中的设置也没有多大意义。
您应该将 Dante 配置为记录,并查看 Dante 日志。由于是 Dante 阻止了连接,因此在 Dante 日志中更容易看到原因是什么。Dante 可能还会在其日志文件中报告您的 danted.conf 的一些问题。
推荐阅读
- discord.js - Discord.js 拍手命令
- c# - 如何找到在解决方案/源代码中使用的类/实体完整命名空间及其使用行号(对象创建)
- r - 错误:不能对不存在的列进行子集化。ggstatsplot 包
- c# - C# 中 JSONSchema 的运行时对象
- python - 您如何使用 Selenium Chrome 浏览器保持登录状态?
- postgresql - 如何在 Postgres 中使用多个 distinct on 语句,同时保持正确的顺序
- esper - 如何清理基础语句为“INSERT INTO”的 EPStatement#iterator()
- java - 从java中的数据库自动创建单选按钮
- sql - 自动从表中删除数据?
- android - 未生成 Sqldelight 数据库架构