在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代理了