Skip to content

Commit

Permalink
Init project
Browse files Browse the repository at this point in the history
  • Loading branch information
521xueweihan committed Dec 9, 2016
1 parent 3aa0045 commit c0dabae
Show file tree
Hide file tree
Showing 22 changed files with 1,696 additions and 10 deletions.
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules

# Mac
.DS_Store
34 changes: 34 additions & 0 deletions Cakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{spawn} = require 'child_process'

build = (callback) ->
os = require 'os'
if os.platform() == 'win32'
coffeeCmd = 'coffee.cmd'
else
coffeeCmd = 'coffee'
coffee = spawn coffeeCmd, ['-c', '-o', '.', 'src']
coffee.stderr.on 'data', (data) ->
process.stderr.write data.toString()
coffee.stdout.on 'data', (data) ->
console.log data.toString()
coffee.on 'exit', (code) ->
console.log 'build completed'
callback?() if code is 0
process.exit code

test = (callback) ->
os = require 'os'
coffee = spawn 'node', ['test.js']
coffee.stderr.on 'data', (data) ->
process.stderr.write data.toString()
coffee.stdout.on 'data', (data) ->
console.log data.toString()
coffee.on 'exit', (code) ->
callback?() if code is 0
process.exit code

task 'build', 'Build ./ from src/', ->
build()

task 'test', 'Run unit test', ->
test()
21 changes: 11 additions & 10 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2016 削微寒
The MIT License (MIT)
Copyright (c) 2016 Xueweihan
Copyright (c) 2014 Zhao Xiaohong
Copyright (c) 2012-2014 clowwindy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -12,10 +13,10 @@ furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: npm start
71 changes: 71 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
> Fork 于 [shadowsocks-heroku](https://github.com/mrluanma/shadowsocks-heroku) 项目
# shadowsocks-heroku
[Heroku](https://www.heroku.com/) 是一个支持多种编程语言的云平台即服务,shadowsocks-heroku 则是可部署在 Heroku 平台的ss服务。
[shadowsocks](https://github.com/clowwindy/shadowsocks) 不同的是 shadowsocks-heroku 使用的 WebSocket 代替原本的 sockets。

本项目主要介绍如何利用 heroku 部署 [shadowsocks-heroku](https://github.com/mrluanma/shadowsocks-heroku) 项目。预计十分钟后,你就可以 google 了。

### 一、准备
#### 1.注册 Heroku 帐号
Heroku 提供免费账号,具体限制如下:
- Run apps for free using your monthly pool of free dyno hours
- Unverified accounts: receive a pool of 550 free dyno hours
- Verified accounts: receive an additional 450 free dyno hours
- Dyno hours can be shared across any of your free apps
- 1 web dyno/1 worker dyno/1 one-off dyno maximum per app
- 512 MB RAM per dyno
- Free apps sleep automatically after 30 mins of inactivity to conserve your dyno hours
- Free apps wake automatically when a web request is received
- Access to the Heroku Dashboard and Heroku CLI for app management
- Custom domains for every free app (with verified account)
- Up to 5 free apps (unverified) or 100 (verified)

用作 VPS 是够了,注册地址:https://signup.heroku.com/

#### 2.Fork本项目
1. Fork 本项目到个人账号下
![](https://github.com/521xueweihan/shadowsocks-heroku/blob/master/img/4-min.png)

2. Clone 本项目:`git clone https://github.com/521xueweihan/shadowsocks-heroku.git`

### 二、部署
heroku 在创建项目的时候可以,通过关联 GitHub 账号,直接部署 GitHub 账号下的项目。具体步骤如下:

1. 登陆 Heroku 帐号,后进入 Dashboard ——> Create New App ——> 输入 App Name
2. 完成上一步后,会跳转到 Deploy 页面,找到 Deployment method 选择 GitHub 关联上自己的 GitHub 帐号。
3. 关联上 shadowsocks-heroku 项目,如下图所示:
![](https://github.com/521xueweihan/shadowsocks-heroku/blob/master/img/1-min.png)
4. 点击 Deploy Branch,部署成功如下图:
![](https://github.com/521xueweihan/shadowsocks-heroku/blob/master/img/2-min.png)

### 三、设置加密算法和密码
Setting 页面 ——> Reveal Config Vars,设置参数如下图:
![](https://github.com/521xueweihan/shadowsocks-heroku/blob/master/img/3-min.png)

### 四、启动本地 client:
1. **进到本项目目录**,执行`npm install` 命令,安装依赖的库(如没有 npm ,请自行安装,[npm安装依赖慢](http://www.cnblogs.com/xueweihan/p/5491730.html)
2. 启动本地 client,`node local.js -s 你的app名称.herokuapp.com -l 1080 -m 设置的加密算法 -k 设置的密码 -r 80`

### 五、最后
1. 下载:Chrome 浏览器[SwitchyOmega](https://github.com/FelisCatus/SwitchyOmega/releases/download/v2.3.21/SwitchyOmega.crx),如果下载地址失效,可以在本项目下的 download 下找到 SwitchyOmega.crx
2. 安装:打开浏览器的扩展程序页面 chrome://extensions 。把SwitchyOmega.crx文件拖放到浏览器扩展程序页面安装。
3. 配置:SwitchyOmega:`代理协议:SOCKS5 代理服务器:127.0.0.1 代理端口:1080`,如下图:
![](https://github.com/521xueweihan/shadowsocks-heroku/blob/master/img/5-min.png)

### 支持的加密算法
- rc4
- rc4-md5
- table
- bf-cfb
- des-cfb
- rc2-cfb
- idea-cfb
- seed-cfb
- cast5-cfb
- aes-128-cfb
- aes-192-cfb
- aes-256-cfb
- camellia-256-cfb
- camellia-192-cfb
- camellia-128-cfb
10 changes: 10 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"server": "127.0.0.1",
"local_address": "127.0.0.1",
"scheme": "ws",
"local_port": 1080,
"remote_port": 8080,
"password": "`try*(^^$some^$%^complex>:<>?~password/",
"timeout": 600,
"method": "rc4-md5"
}
Binary file added download/SwitchyOmega.crx
Binary file not shown.
207 changes: 207 additions & 0 deletions encrypt.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added img/1-min.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/2-min.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/3-min.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/4-min.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/5-min.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c0dabae

Please sign in to comment.