Skip to content

Commit

Permalink
Merge pull request #223 from xream/feature/V2Ray
Browse files Browse the repository at this point in the history
feat: V2Ray Producer
Fixes #180
  • Loading branch information
xream committed Jul 26, 2023
2 parents edee10c + 8e49a78 commit 26d47b0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.14.1",
"version": "2.14.2",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions backend/src/core/proxy-utils/producers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Clash_Producer from './clash';
import Stash_Producer from './stash';
import Loon_Producer from './loon';
import URI_Producer from './uri';
import V2Ray_Producer from './v2ray';
import QX_Producer from './qx';

function JSON_Producer() {
Expand All @@ -17,6 +18,7 @@ export default {
Loon: Loon_Producer(),
Clash: Clash_Producer(),
URI: URI_Producer(),
V2Ray: V2Ray_Producer(),
JSON: JSON_Producer(),
Stash: Stash_Producer(),
};
12 changes: 12 additions & 0 deletions backend/src/core/proxy-utils/producers/v2ray.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* eslint-disable no-case-declarations */
import { Base64 } from 'js-base64';
import URI_Producer from './uri';

const URI = URI_Producer();

export default function V2Ray_Producer() {
const type = 'ALL';
const produce = (proxies) =>
Base64.encode(proxies.map((proxy) => URI.produce(proxy)).join('\n'));
return { type, produce };
}

0 comments on commit 26d47b0

Please sign in to comment.