登陆linux vps,
建议先设置虚拟环境模式
easy_install virtualenv
root@as3:~# virtualenv dev
显示:
New python executable in dev/bin/python
Installing Setuptools.......................................................................................
.................................................................................................
......................................done.
Installing Pip..............................................................................................
.................................................................................................
.................................................................................................
.....................................done.
root@as3:~# dev/bin/python --version
Python 2.7.6
root@as3:~# cd dev
root@as3:~/dev# ls
bin include lib
root@as3:~/dev# ls bin
activate activate.fish easy_install pip python python2.7
activate.csh activate_this.py easy_install-2.7 pip-2.7 python2
root@as3:~/dev# source bin/activate (激活dev这个环境,这会让dev虚拟环境下的site-packages成为默认的版本)
(dev)root@as3:~/dev# (运行source /root/dev/bin/activate激活虚拟环境后,提示符就由“root@as3:~/dev#”变成了
“(dev)root@as3:~/dev#”,说明现在进入了虚拟环境模式!至此,虚拟环境模式设置成功)
git clone https://github.com/felix021/mixo
cd mixo
(dev) root@ar:~/dev/mixo# make (这步运行后,会在当前目录下,生成xor.so文件,此文件是用来加密的。)
(dev) root@ar:~/dev/mixo# python server.py
please install gevent first!
(dev) root@ar:~/dev/mixo# pip install gevent
Collecting gevent
Downloading gevent-1.2.2-cp27-cp27mu-manylinux1_x86_64.whl (1.6MB)
100% |################################| 1.6MB 146kB/s
Collecting greenlet>=0.4.10 (from gevent)
Downloading greenlet-0.4.13-cp27-cp27mu-manylinux1_x86_64.whl (41kB)
100% |################################| 51kB 2.3MB/s
Installing collected packages: greenlet, gevent
Successfully installed gevent-1.2.2 greenlet-0.4.13
(dev) root@ar:~/dev/mixo# python server.py
注:服务器端无须修改配置文件config.py;当然如果你愿意,你也可修改server_port的值9998为服务器上未被占用的其他端口,比如13208
会显示:
loaded ./xor.so, using faster xor
Server is listening on 0.0.0.0:13208
这是以前台方式运行。建议使用systemd,使其以service方式运行。按ctrl+c退出,然后,
建议先设置虚拟环境模式
easy_install virtualenv
(运行pip install virtualenv这条命令容易出错,
所以easy_install比pip install更好)virtualenv dev (在当前目录下会生成dev目录)
root@as3:~# virtualenv dev
显示:
New python executable in dev/bin/python
Installing Setuptools.......................................................................................
.................................................................................................
......................................done.
Installing Pip..............................................................................................
.................................................................................................
.................................................................................................
.....................................done.
root@as3:~# dev/bin/python --version
Python 2.7.6
root@as3:~# cd dev
root@as3:~/dev# ls
bin include lib
root@as3:~/dev# ls bin
activate activate.fish easy_install pip python python2.7
activate.csh activate_this.py easy_install-2.7 pip-2.7 python2
root@as3:~/dev# source bin/activate (激活dev这个环境,这会让dev虚拟环境下的site-packages成为默认的版本)
(dev)root@as3:~/dev# (运行source /root/dev/bin/activate激活虚拟环境后,提示符就由“root@as3:~/dev#”变成了
“(dev)root@as3:~/dev#”,说明现在进入了虚拟环境模式!至此,虚拟环境模式设置成功)
git clone https://github.com/felix021/mixo
cd mixo
(dev) root@ar:~/dev/mixo# make (这步运行后,会在当前目录下,生成xor.so文件,此文件是用来加密的。)
(dev) root@ar:~/dev/mixo# python server.py
please install gevent first!
(dev) root@ar:~/dev/mixo# pip install gevent
Collecting gevent
Downloading gevent-1.2.2-cp27-cp27mu-manylinux1_x86_64.whl (1.6MB)
100% |################################| 1.6MB 146kB/s
Collecting greenlet>=0.4.10 (from gevent)
Downloading greenlet-0.4.13-cp27-cp27mu-manylinux1_x86_64.whl (41kB)
100% |################################| 51kB 2.3MB/s
Installing collected packages: greenlet, gevent
Successfully installed gevent-1.2.2 greenlet-0.4.13
(dev) root@ar:~/dev/mixo# python server.py
注:服务器端无须修改配置文件config.py;当然如果你愿意,你也可修改server_port的值9998为服务器上未被占用的其他端口,比如13208
会显示:
loaded ./xor.so, using faster xor
Server is listening on 0.0.0.0:13208
这是以前台方式运行。建议使用systemd,使其以service方式运行。按ctrl+c退出,然后,
nano /etc/systemd/system/mixo.service
内容如下:
[Unit]
Description=mixo
After=network.target
[Service]
ExecStartPre=source /root/dev/bin/activate
ExecStart=/root/dev/bin/python /root/mixo/server.py
Restart=always
[Install]
WantedBy=multi-user.target
启动mixo:
systemctl start mixo
这其实就是以daemon(service)方式启动mixo程序。
设置开机启动:
systemctl enable mixo
至此,mixo服务器端的配置已经全部完成.
在客户机器
mac上,
git clone https://github.com/felix021/mixo
cd mixo
make
(这步运行后,会在当前目录下,生成xor.so文件,此文件是用来加密的。)
nano config.py
(把server_host的值改为你vps的公网ip)
python client.py
(不要关闭这个terminal)
然后设置浏览器的socks5代理服务器为127.0.0.1:9999,浏览器即可翻墙。
项目地址:https://github.com/felix021/mixo
No comments:
Post a Comment