mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 00:52:40 +00:00
Now an error will be thrown if a required field of a proxy is missing
This commit is contained in:
@@ -34,6 +34,9 @@ function shadowsocks(proxy) {
|
||||
append(`,password=${proxy.password}`);
|
||||
|
||||
// obfs
|
||||
if (needTls(proxy)) {
|
||||
proxy.tls = true;
|
||||
}
|
||||
if (isPresent(proxy, 'plugin')) {
|
||||
if (proxy.plugin === 'obfs') {
|
||||
const opts = proxy['plugin-opts'];
|
||||
@@ -187,6 +190,9 @@ function vmess(proxy) {
|
||||
append(`,password=${proxy.uuid}`);
|
||||
|
||||
// obfs
|
||||
if (needTls(proxy)) {
|
||||
proxy.tls = true;
|
||||
}
|
||||
if (isPresent(proxy, 'network')) {
|
||||
if (proxy.network === 'ws') {
|
||||
if (proxy.tls) append(`,obfs=wss`);
|
||||
|
||||
@@ -7,6 +7,9 @@ export class Result {
|
||||
}
|
||||
|
||||
append(data) {
|
||||
if (typeof data === 'undefined') {
|
||||
throw new Error('required field is missing');
|
||||
}
|
||||
this.output.push(data);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user