Total Pageviews

Tuesday 12 May 2020

利用socks5-proxy-by-yuanrenguang715翻墙

在linux vps上。安装go1.13环境。然后,
git clone https://github.com/luckypoem/socks5-proxy socks5-proxy-by-yuanrenguang715
cd socks5-proxy-by-yuanrenguang715
cd server
go install
(server目录里有.go文件和go.sum, go.mod文件,于是可以运行go install来安装程序
which server
$GOBIN/server
($GOBIN/里面就 出现了可执行文件server
mv $GOBIN/server $GOBIN/server-based-on-socks5-proxy-by-yuanrenguang715
nano config.ini
cat config.ini
[server]
default_port = 23685

然后,
nano /etc/systemd/system/socks5-proxy-by-yuanrenguang715.service
cat /etc/systemd/system/socks5-proxy-by-yuanrenguang715.service
[Unit]
After=network.target

[Service]
WorkingDirectory=/root/socks5-proxy-by-yuanrenguang715/server/
ExecStart=/root/go/gopath/bin/server-based-on-socks5-proxy-by-yuanrenguang715
Restart=always

[Install]
WantedBy=multi-user.target

然后运行:
systemctl start socks5-proxy-by-yuanrenguang715
systemctl enable socks5-proxy-by-yuanrenguang715
服务器端搭建完成。

在客户机器mac上。安装go1.13环境。然后,
git clone https://github.com/luckypoem/socks5-proxy socks5-proxy-by-yuanrenguang715
cd socks5-proxy-by-yuanrenguang715
cd client
go install
(client目录里有.go文件和go.sum, go.mod文件,于是可以运行go install来安装程序
which client
$GOBIN/client
($GOBIN/里面就 出现了可执行文件client
mv $GOBIN/client $GOBIN/client-based-on-socks5-proxy-by-yuanrenguang715
nano config.ini
cat config.ini
[clinets]
server_ip = your-vps-public-ip
default_port = 2553
server_port = 23685

然后运行:
client-based-on-socks5-proxy-by-yuanrenguang715
不要关闭此terminal.
然后设置chrome的socks5代理服务器地址为127.0.0.1 ,端口为2553 ,chrome即可翻墙。

https://github.com/luckypoem/socks5-proxy
 
不用看下面的内容了,那是旧版
-------------------------------------------------------------

另外,我克隆了旧版:https://github.com/nopw/socks5-proxy为https://github.com/briteming/socks5-proxy
然后修改了https://github.com/briteming/socks5-proxy/blob/master/client/client.go文件的第10,11行分别为:
"github.com/briteming/socks5-proxy/utils/config"
"github.com/briteming/socks5-proxy/utils/logger"

修改https://github.com/briteming/socks5-proxy/blob/master/utils/config/client.go文件的第4行为:
"github.com/briteming/socks5-proxy/utils/logger"

修改了https://github.com/briteming/socks5-proxy/blob/master/server/server.go文件的第12,13行分别为:
"github.com/briteming/socks5-proxy/utils/config"
"github.com/briteming/socks5-proxy/utils/logger"

修改了https://github.com/briteming/socks5-proxy/blob/master/utils/config/server.go文件的第4行为:
"github.com/briteming/socks5-proxy/utils/logger"

在本地机器mac上,安装go1.13环境。然后,
git clone https://github.com/briteming/socks5-proxy socks5-proxy-by-briteming
cd socks5-proxy-by-briteming
cd client
go build
(client目录里只有一个go文件:client.go,于是运行go build ,就会在当前目录下生成可执行文件client)
nano config.ini
cat config.ini
[clinets]
server_ip = my-vps-public-ip
default_port = 2553
server_port = 23685

然后运行:
./client
不要关闭此terminal.

在linux vps上。安装go1.13环境。然后,
git clone https://github.com/briteming/socks5-proxy socks5-proxy-by-briteming
cd socks5-proxy-by-briteming
cd server
go build

运行go build会遇错:
server.go:12:2: cannot find package "github.com/briteming/socks5-proxy/utils/config" in any of:
/root/go/src/github.com/briteming/socks5-proxy/utils/config (from $GOROOT)
/root/go/gopath/src/github.com/briteming/socks5-proxy/utils/config (from $GOPATH)
server.go:13:2: cannot find package "github.com/briteming/socks5-proxy/utils/logger" in any of:
/root/go/src/github.com/briteming/socks5-proxy/utils/logger (from $GOROOT)
/root/go/gopath/src/github.com/briteming/socks5-proxy/utils/logger (from $GOPATH)

解决办法:
cd $GOPATH
go get -u -v github.com/briteming/socks5-proxy/server/
which server
显示:
/root/go/gopath/bin/server
-----------------------------
 
use socks5-proxy-by-yuanrenguang715 to cross gfw

on your linux vps,firstly install the go 1.13 environment.then,

cd $GOPATH

go get -u -v github.com/briteming/socks5-proxy/server/

which server

it shows:

/root/go/gopath/bin/server

this means the server-end is installed successfully.

mv $GOBIN/server $GOBIN/server-based-on-socks5-proxy-by-yuanrenguang715

mkdir -p /root/socks5-proxy-by-yuanrenguang715/server/

cd /root/socks5-proxy-by-yuanrenguang715/server/

wget https://github.com/briteming/socks5-proxy/raw/master/server/config.ini

nano config.ini

the config.ini contents is:

[server]

default_port = 23685

then,

nano /etc/systemd/system/socks5-proxy-by-yuanrenguang715.service

its contents is:

[Unit]

After=network.target
[Service]

WorkingDirectory=/root/socks5-proxy-by-yuanrenguang715/server/

ExecStart=/root/go/gopath/bin/server-based-on-socks5-proxy-by-yuanrenguang715

Restart=always
[Install]

WantedBy=multi-user.target

then,run:

systemctl start socks5-proxy-by-yuanrenguang715

systemctl enable socks5-proxy-by-yuanrenguang715

on local machine mac,firstly install go1.13。then,


git clone https://github.com/briteming/socks5-proxy socks5-proxy-by-briteming


cd socks5-proxy-by-briteming


cd client


go build 
(under the current dir, a executable file client will be generated.)


nano config.ini


its contents is:

[clinets]

server_ip = my-vps-public-ip

default_port = 2553

server_port = 23685

then run:./client

don’t close this terminal.

then, set chrome’s socks5 proxy server to be 127.0.0.1 ,port to be 2553 ,chrome just can cross the wall.

project url: https://github.com/briteming/socks5-proxy

No comments:

Post a Comment