-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
totravel
committed
Jan 12, 2022
1 parent
340d309
commit 2a0b0c0
Showing
4 changed files
with
39 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
![License](https://img.shields.io/github/license/totravel/shadowsocks-ws) | ||
![GitHub last commit](https://img.shields.io/github/last-commit/totravel/shadowsocks-ws) | ||
|
||
shadowsocks-ws 是基于 WebSocket 的 Shadowsocks,可以部署在 [Heroku](https://www.heroku.com/)。 | ||
shadowsocks-ws 是基于 WebSocket 的 Shadowsocks,可以部署在 [Heroku](https://www.heroku.com/) 等托管平台。 | ||
|
||
``` | ||
socks5 tcp websocket tcp | ||
|
@@ -28,56 +28,36 @@ shadowsocks-ws 的客户端只负责转发经过加密的流量,须配合现 | |
- [ws](https://github.com/websockets/ws) | ||
- [futoin-hkdf](https://github.com/futoin/util-js-hkdf) | ||
|
||
## 部署到 Heroku | ||
## 部署 | ||
|
||
### 一键部署 | ||
|
||
点击下面的按钮并根据提示操作。 | ||
### Heroku | ||
|
||
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) | ||
|
||
### 手动部署 | ||
|
||
打开终端,登录你的 Heroku 账户: | ||
### Railway | ||
|
||
```shell | ||
$ heroku auth:login -i | ||
heroku: Enter your login credentials | ||
Email: [email protected] | ||
Password: ***** | ||
Logged in as [email protected] | ||
``` | ||
Create a empty project. | ||
|
||
将你的 SSH 公钥添加到 Heroku: | ||
Connect to the project: | ||
|
||
```shell | ||
$ heroku keys:add | ||
Found an SSH public key at /path/to/id_rsa.pub | ||
? Would you like to upload it to Heroku? (Y/n) y | ||
``` | ||
|
||
新建一个 APP: | ||
|
||
```shell | ||
$ heroku create | ||
Creating app... done, ⬢ xxxxx | ||
https://<your-app>.herokuapp.com/ | https://git.heroku.com/<your-app>.git | ||
$ git clone https://github.com/totravel/shadowsocks-ws.git | ||
$ cd shadowsocks-ws | ||
$ railway link [projectId] | ||
``` | ||
|
||
设置加密方法、密码: | ||
Add some variables: | ||
|
||
```shell | ||
$ heroku config:set METHOD="chacha20-ietf-poly1305" PASS="your-password" --app <your-app> | ||
$ railway variables set METHOD=aes-256-gcm | ||
$ railway variables set PASS=secret | ||
$ railway variables set PORT=80 | ||
``` | ||
|
||
仅支持 `chacha20-ietf-poly1305` 和 `aes-256-gcm` 两种加密方法。 | ||
|
||
克隆代码到本地,再推送到 APP: | ||
Create a deployment: | ||
|
||
```shell | ||
$ git clone https://github.com/totravel/shadowsocks-ws.git | ||
$ cd shadowsocks-ws | ||
$ git push https://git.heroku.com/<your-app>.git master | ||
$ railway up | ||
``` | ||
|
||
## 本地配置 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
node local | ||
node local.mjs | ||
pause |