Skip to content

Commit

Permalink
feat: 支持 Hysteria 2
Browse files Browse the repository at this point in the history
  • Loading branch information
geekdada committed Oct 14, 2023
1 parent be0dadd commit 0603add
Show file tree
Hide file tree
Showing 22 changed files with 1,851 additions and 1,685 deletions.
9 changes: 9 additions & 0 deletions docs/guide/custom-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,15 @@ module.exports = {

目前仅 Stash 支持 shadow-tls,如果你希望在 Shadowsocks 节点中使用 shadow-tls 请开启此项。

### clashConfig.enableHysteria2

> <Badge text="v3.1.0" vertical="middle" />
- 类型: `boolean`
- 默认值: `false`

目前仅 Clash Meta 内核支持 Hysteria v2,如果你希望在 Clash 订阅中输出 Hysteria v2 节点请开启此项。

## surfboardConfig

- 类型: `object`
Expand Down
29 changes: 29 additions & 0 deletions docs/guide/custom-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,28 @@ module.exports = defineCustomProvider({
}
```

### Hysteria

> <Badge text="Surgio v3.1.0" vertical="middle" />
Surgio 只支持 Hysteria v2 协议。请注意,Hysteria v2 协议和 v1 协议完全不兼容。当前可以为 Clash 和 Surge 生成此节点。

Clash 需要在配置中开启 `clashConfig.enableHysteria2`

```json5
{
type: 'hysteria2',
nodeName: 'Hysteria',
hostname: 'hysteria.example.com',
port: 443,
password: 'password',
sni: 'sni.example.com', // 可选
skipCertVerify: true, // 可选
alpn: ['h3'], // 可选,Stash 不支持空值
udpRelay: false, // 可选, 仅 Clash 支持更改,Surge 默认开启
}
```

## SSD 订阅

```js
Expand Down Expand Up @@ -652,6 +674,13 @@ Surgio 不会验证名称是否有效

用于验证服务器证书的 SHA256 指纹。目前仅 Surge 支持该特性。

### nodeConfig.ecn

- 类型: `boolean`
- 默认值: `false`

是否为该节点开启 [ECN(Explicit Congestion Notification)](https://yach.me/2023/10/14/ccn-and-ecn/)。目前仅 Surge 支持这一特性。

### provider.nodeFilter

- 类型: `Function`
Expand Down
95 changes: 48 additions & 47 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@
"homepage": "https://surgio.js.org",
"scripts": {
"dev": "npm run build -- --watch",
"test": "run-s build test:*",
"test": "run-s build test:lint test:unit test:cli",
"test:types": "tsc --noEmit",
"test:lint": "eslint -c .eslintrc.js --ext .js,.ts .",
"test:unit": "ava",
"test:cli": "mocha",
"test:cli:update": "CHAI_JEST_SNAPSHOT_UPDATE_ALL=true pnpm test:cli",
"run-example": "node ./scripts/run-example.js",
"coverage": "TS_NODE_FILES=true nyc ava",
"clean": "rimraf build",
Expand Down Expand Up @@ -71,35 +72,35 @@
"topics": {}
},
"dependencies": {
"@babel/parser": "^7.22.5",
"@babel/parser": "^7.23.0",
"@brillout/import": "^0.2.3",
"@oclif/core": "^2.8.7",
"@oclif/plugin-help": "^5.2.10",
"@oclif/plugin-plugins": "^3.1.3",
"@oclif/core": "^2.15.0",
"@oclif/plugin-help": "^5.2.20",
"@oclif/plugin-plugins": "^3.9.1",
"@royli/hygen": "^6.2.0",
"@surgio/eslint-config-surgio": "^1.0.6",
"@surgio/logger": "^1.3.0",
"@types/eslint": "^8.40.2",
"agentkeepalive": "^4.3.0",
"ali-oss": "^6.17.1",
"@types/eslint": "^8.44.4",
"agentkeepalive": "^4.5.0",
"ali-oss": "^6.18.1",
"bluebird": "^3.7.2",
"bytes": "^3.1.2",
"cache-manager": "^5.2.3",
"cache-manager": "^5.2.4",
"cache-manager-ioredis-yet": "^1.2.2",
"chalk": "^4.1.2",
"change-case": "^4.1.2",
"check-node-version": "^4.2.1",
"date-fns": "^2.30.0",
"detect-newline": "^3.1.0",
"dotenv": "^16.3.0",
"dotenv": "^16.3.1",
"emoji-regex": "^10.2.1",
"eslint": "^8.43.0",
"eslint": "^8.51.0",
"execa": "^4.1.0",
"filesize": "^10.0.7",
"filesize": "^10.1.0",
"fs-extra": "^11.1.1",
"got": "^11.8.6",
"hpagent": "^1.2.0",
"inquirer": "^8.2.5",
"inquirer": "^8.2.6",
"ioredis": "^5.3.2",
"lodash": "^4.17.21",
"micromatch": "^4.0.5",
Expand All @@ -110,39 +111,39 @@
"query-string": "^7.1.3",
"rimraf": "^4.4.1",
"source-map-support": "^0.5.21",
"type-fest": "^3.12.0",
"type-fest": "^3.13.1",
"update-notifier": "^5.1.0",
"urlsafe-base64": "^1.0.0",
"yaml": "^2.3.1",
"zod": "^3.21.4",
"zod-validation-error": "^1.3.0"
"yaml": "^2.3.2",
"zod": "^3.22.4",
"zod-validation-error": "^1.5.0"
},
"devDependencies": {
"@algolia/client-search": "^4.17.2",
"@commitlint/cli": "^17.6.5",
"@commitlint/config-angular": "^17.6.5",
"@algolia/client-search": "^4.20.0",
"@commitlint/cli": "^17.7.2",
"@commitlint/config-angular": "^17.7.0",
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@oclif/test": "^2.3.22",
"@oclif/test": "^2.5.6",
"@types/ali-oss": "^6.16.9",
"@types/bluebird": "^3.5.38",
"@types/bytes": "^3.1.1",
"@types/chai": "^4.3.5",
"@types/debug": "^4.1.8",
"@types/fs-extra": "^11.0.1",
"@types/bluebird": "^3.5.40",
"@types/bytes": "^3.1.2",
"@types/chai": "^4.3.8",
"@types/debug": "^4.1.9",
"@types/fs-extra": "^11.0.2",
"@types/ini": "^1.3.31",
"@types/inquirer": "^8.2.6",
"@types/ioredis-mock": "^8.2.2",
"@types/lodash": "^4.14.195",
"@types/micromatch": "^4.0.2",
"@types/mocha": "^10.0.1",
"@types/ms": "^0.7.31",
"@types/node": "^18.16.18",
"@types/inquirer": "^8.2.7",
"@types/ioredis-mock": "^8.2.3",
"@types/lodash": "^4.14.199",
"@types/micromatch": "^4.0.3",
"@types/mocha": "^10.0.2",
"@types/ms": "^0.7.32",
"@types/node": "^18.18.5",
"@types/node-dir": "^0.0.35",
"@types/nunjucks": "^3.2.2",
"@types/sinon": "^10.0.15",
"@types/urlsafe-base64": "^1.0.28",
"@typescript-eslint/eslint-plugin": "^5.59.11",
"@typescript-eslint/parser": "^5.59.11",
"@types/nunjucks": "^3.2.4",
"@types/sinon": "^10.0.19",
"@types/urlsafe-base64": "^1.0.29",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@vuepress/client": "2.0.0-beta.62",
"@vuepress/plugin-docsearch": "2.0.0-beta.62",
"@vuepress/plugin-google-analytics": "2.0.0-beta.62",
Expand All @@ -151,31 +152,31 @@
"@vuepress/utils": "2.0.0-beta.62",
"ava": "^5.3.1",
"benchmark": "^2.1.4",
"bumpp": "^9.1.1",
"chai": "^4.3.7",
"bumpp": "^9.2.0",
"chai": "^4.3.10",
"chai-jest-snapshot": "^2.0.0",
"conventional-changelog-cli": "^2.2.2",
"eslint-config-prettier": "^8.8.0",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.3",
"ini": "^3.0.1",
"ioredis-mock": "^8.7.0",
"lint-staged": "^13.2.2",
"ioredis-mock": "^8.9.0",
"lint-staged": "^13.3.0",
"mocha": "^10.2.0",
"nock": "^13.3.1",
"nock": "^13.3.4",
"np": "^6.5.0",
"npm-debug-log-cleaner": "^1.0.3",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"prettier": "^2.8.8",
"sass": "^1.63.4",
"sinon": "^15.1.2",
"sass": "^1.69.3",
"sinon": "^15.2.0",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"vue": "^3.3.4",
"vuepress": "2.0.0-beta.62",
"vuepress-plugin-sitemap2": "2.0.0-beta.205",
"vuepress-plugin-umami-analytics": "^1.2.0"
"vuepress-plugin-umami-analytics": "^1.5.0"
},
"ava": {
"failFast": false,
Expand Down
Loading

0 comments on commit 0603add

Please sign in to comment.