mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
feat(config): ✨ Add support for HTTP proxies on outgoing requests
This commit is contained in:
parent
0ecb65de29
commit
b8b822e553
13 changed files with 225 additions and 136 deletions
|
|
@ -123,21 +123,16 @@ export const configValidator = z.object({
|
|||
proxy: z
|
||||
.object({
|
||||
enabled: z.boolean().default(false),
|
||||
host: z.string().min(1).default("localhost"),
|
||||
port: z
|
||||
.number()
|
||||
.int()
|
||||
.min(1)
|
||||
.max(2 ** 16 - 1)
|
||||
.default(9050),
|
||||
type: z.enum(["socks4", "socks4a", "socks5"]).default("socks5"),
|
||||
address: zUrl,
|
||||
})
|
||||
.default({
|
||||
enabled: false,
|
||||
host: "localhost",
|
||||
port: 9050,
|
||||
type: "socks5",
|
||||
}),
|
||||
address: "",
|
||||
})
|
||||
.transform((arg) => ({
|
||||
...arg,
|
||||
address: arg.enabled ? arg.address : undefined,
|
||||
})),
|
||||
tls: z
|
||||
.object({
|
||||
enabled: z.boolean().default(false),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue