another attempt
This commit is contained in:
parent
117ff56d1e
commit
a984733b9b
3 changed files with 25 additions and 4 deletions
|
|
@ -240,7 +240,11 @@ export class ProxyService {
|
|||
for (const proxy of proxies) {
|
||||
const key = this.getProxyKey(proxy);
|
||||
const data: ProxyData = {
|
||||
...proxy,
|
||||
protocol: proxy.protocol,
|
||||
host: proxy.host,
|
||||
port: proxy.port,
|
||||
username: proxy.username,
|
||||
password: proxy.password,
|
||||
addedAt: new Date(),
|
||||
lastChecked: null,
|
||||
isWorking: null,
|
||||
|
|
|
|||
17
apps/data-service/tsconfig.json
Normal file
17
apps/data-service/tsconfig.json
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"declaration": true
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"dist",
|
||||
"node_modules",
|
||||
"**/*.test.ts",
|
||||
"**/*.spec.ts"
|
||||
],
|
||||
}
|
||||
|
|
@ -95,9 +95,9 @@ export function validateProxyConfig(config: unknown): ProxyConfig {
|
|||
|
||||
const proxy = config as Record<string, unknown>;
|
||||
|
||||
// Validate type
|
||||
if (!proxy.type || !['http', 'https', 'socks4', 'socks5'].includes(proxy.type as string)) {
|
||||
throw new Error('Proxy type must be one of: http, https, socks4, socks5');
|
||||
// Validate protocol
|
||||
if (!proxy.protocol || !['http', 'https', 'socks4', 'socks5'].includes(proxy.protocol as string)) {
|
||||
throw new Error('Proxy protocol must be one of: http, https, socks4, socks5');
|
||||
}
|
||||
|
||||
// Validate host
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue