![Dante(SOCKS 服务器)无法正常工作](https://linux22.com/image/508395/Dante%EF%BC%88SOCKS%20%E6%9C%8D%E5%8A%A1%E5%99%A8%EF%BC%89%E6%97%A0%E6%B3%95%E6%AD%A3%E5%B8%B8%E5%B7%A5%E4%BD%9C.png)
我正在尝试使用 dante 设置 SOCKS 代理以进行测试。但是,在查看了几个有关如何操作的教程后,我甚至无法让它与 Web 浏览器配合使用。
我在 IE 和 Firefox 中都尝试过,在两种情况下,都使用“手动代理配置”,除 SOCKS 主机外,其他都留空,然后输入我的代理的 IP 和端口号 (1080)。我只得到“未找到服务器”/“加载此页面时出现问题”,在 danted 中看不到任何内容,即使在调试模式下运行也是如此。
如果我执行“telnet 10.0.0.40 1080”,我确实会在 danted 调试输出中看到打开的连接,所以我知道大部分都在正常工作。
这是我的配置:
logoutput: stdout /var/log/danted/danted.log
internal: eth0 port = 1080
external: eth0
method: username none #rfc931
user.privileged: proxy
user.notprivileged: nobody
user.libwrap: nobody
connecttimeout: 30 # on a lan, this should be enough if method is "none".
client pass {
from: 10.0.0.0/8 port 1-65535 to: 0.0.0.0/0
}
client pass {
from: 127.0.0.0/8 port 1-65535 to: 0.0.0.0/0
}
client block {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: connect error
}
block {
from: 0.0.0.0/0 to: 127.0.0.0/8
log: connect error
}
pass {
from: 10.0.0.0/8 to: 0.0.0.0/0
protocol: tcp udp
}
pass {
from: 127.0.0.0/8 to: 0.0.0.0/0
protocol: tcp udp
}
block {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: connect error
}
我确信我可能忽略了一些简单的东西,但我迷失了。自 90 年代末以来,我甚至没有想过 SOCKS。
答案1
这是由于您使用的 dante-server 版本的配置错误造成的。
这是 Dante v1.4.2 的正确配置
#logoutput: /var/log/socks.log
internal: eth0 port = 1080
external: eth0
method: username none
user.privileged: root
user.notprivileged: nobody
#accept connections from any source (bad way)
client pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: error connect disconnect
}
#accept from your white list source (good way way)
client pass {
from: 1.2.3.4/32 to: 0.0.0.0/0
log: error connect disconnect
}
client block {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: connect error
}
pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: error connect disconnect
}
block {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: connect error
}