在linux环境下搭建sock5代理服务器
用到软件是dante-1.4.0-pre1.tar.gz
下载地址是http://www.inet.no/dante/download.html
 
tar -zxvf dante-1.4.0-pre1.tar.gz
cd dante-1.4.0-pre1
./configure --prefix=/usr/local/dante
make
make install
 
配置文件默认是在/etc/sockd.conf需要手动建立,配置文件说明详情见官方网站,下面的是简单的配置文件,接受所有的代理请求,不需要认证。
 
vim /etc/sockd.conf
 
logoutput: /var/log/sockd.log                ###日志文件地址
#debug: 1
 
internal: 192.168.1.198 port = 1080    ###接入口的ip地址和端口
external: eth0                                      ###出口的网卡号,我这个进出口是同一个
 
user.notprivileged: sockd                      ###以sockd账户启动服务
 
clientmethod: none
method: none
 
client pass {
        from: 192.168.1.0/24 to: 0.0.0.0/0
        log: error # connect disconnect
}
 
pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        command: bind connect udpassociate
        log: error # connect disconnect iooperation
}
 
pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        command: bindreply udpreply
        log: error # connect disconnect iooperation
}
 
新建个运行服务的账户sockd
接着可以运行sockd服务了
 
/usr/local/dante/sbin/sockd  -D
 
最后在应用里面就可以用socks5代理了