利用shadowsocks-nodejs翻墙(原创)

原文:http://briteming.blogspot.com/2012/07/shadowsocks-nodejs.html

前提:你需要一台linux vps.

首先在本地windows安装nodejs环境,下载地址-http://nodejs.org/dist/v0.8.1/node-v0.8.1-x86.msi

用putty登录vps,输入如下命令:

# git clone git://github.com/ry/node.git
# cd node
# ./configure
# make
# make install

这样,vps上的node环境也搭建好了。

下载源码:
 # git clone git://github.com/clowwindy/shadowsocks-nodejs.git
# cd shadowsocks-nodejs
修改里面的config.json文件如下:
{
    "server":"your-vps-ip",
    "server_port":8389, (因为我已在vps上装了shadowsocks,它占用了8388,所以此处改为8389)
    "local_port":1083, (因为我已在vps上装了shadowsocks,它对应的客户端机器的端口是1080,所以此处需要修改为其他值,我改为了1083)
    "password":"your-password",
    "timeout":60
}





运行服务器端程序:
# nohup node server.js >log & (这样node就会在后台运行;即使你关闭了putty,node依然会在你的vps里运行。注意:这里不要用setsid node server.js,这种setsid命令不太可靠,在你关闭putty后,相关的服务比如node很容易退出,并未在后台运行。)

回到本地windows机器,下载源码: https://github.com/clowwindy/shadowsocks-nodejs/zipball/master,解压,进入解压出来的目录,
修改里面的config.json文件如下:
{
    "server":"your-vps-ip",
    "server_port":8389, (因为我已在vps上装了shadowsocks,它占用了8388,所以此处改为8389)
    "local_port":1083, (因为我已在vps上装了shadowsocks,它对应的客户端机器的端口是1080,所以此处需要修改为其他值,我改为了1083)
    "password":"your-password",
    "timeout":60
}

复制config.json到用户目录(我的是c:\users\my-username),然后在开始 -> 运行 -> cmd里面输入命令node i:\shadowsocks-nodejs\local.js(这里i:\shadowsocks-nodejs为我的解压目录路径,请改为你的解压目录路径),回车,如果显示:
calculating ciphers
server listening at port 1083
然后设置浏览器的socks5 代理为127.0.0.1:1083,即可翻#墙.

项目地址: https://github.com/clowwindy/shadowsocks-nodejs

1 条评论:

Kenyon Lester 说...

Limy Dedicated Servers are the ultimate hosting solution that the ever-changing online industry can offer at the moment. With total authority over your own server and its excellent response time, your site will grow together with your business and you will keep your customers highly satisfied. You do not have to worry about sharing your resources – you get an entire server with all the space and bandwidth at your disposal.