Total Pageviews

Saturday 28 September 2019

socks代理服务器程序:socks5-by-physacco


This is an extremely fast, clean and easy-to-use SOCKS5 proxy server written in Go.

Installation

It is assumed that you have set GOPATH in your environment and added $GOPATH/bin to your PATH. Then you can use the following command to automatically download, compile and install this software:
cd $GOPATH
go get -u -v github.com/physacco/socks5
If all goes well, there will be a newly compiled executable file named socks5 (or socks5.exe on Windows platform) in your $GOPATH/bin directory.

Usage

Start a SOCKS5 server:
socks5 [host]:port
To stop the server:
  • just press Ctrl-C, or
  • kill the process with this command: pkill -f socks5

Examples

  1. Listen on *:5080:
    socks5 :5080
  2. Listen on localhost:5080:
    socks5 localhost:5080

    from  https://github.com/physacco/socks5

    这个socks代理服务器程序可以用作tunnel程序的后端。
--------------------------------------------

一个用golang写的socks5代理服务器.

Socks5Server

一个用golang写的socks5代理服务器,主要代理功能代码沿用了physacco/socks5的,然后再原来的基础上面增加了Ip白名单和json配置功能。关于socks5协议可以查维基百科上面关于socks协议的介绍。
#安装
git clone https://github.com/farmercode/Socks5Server.git
cd Socks5Server
go build socks5server.go
./socks5server
#如果需要后台执行可以使用下面命令
./socks5server > /dev/null 2>&1 &
#如果需要记录日志文件可以使用nohup
nohup ./socks5server &
#或者重定向到自己指定的一个文件
./socks5server > server.log 2>&1 &
#配置文件 config.json为配置文件
Listen 为要代理服务器监听ip和端口,格式为 host:port , 如 127.0.0.01:9527
WhiteList为Ip白名单,当WhiteList为空时,所有Ip地址都可以连接,WhiteList不为空时,只允许WhiteList中的Ip进行代理,如 ["127.0.0.1","180.168.85.190"]