mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-15 07:40:59 +00:00
fix(outbound): preserve custom headers for HTTP outbounds (#5519)
The Outbounds form routed HTTP through the SOCKS-shared simpleAuth adapter, which only knew address/port/user/pass, so xray's top-level settings.headers was dropped on both load and save. Opening and re-saving an HTTP outbound destroyed its headers. Add headers to the HTTP wire/form schemas, round-trip it via dedicated httpFromWire/httpToWire helpers, and expose a HeaderMapEditor in the form. Only settings-level headers round-trip; xray-core ignores per-server headers.
This commit is contained in:
@@ -80,6 +80,7 @@ export const HttpOutboundFormSettingsSchema = z.object({
|
||||
port: PortSchema.default(8080),
|
||||
user: z.string().default(''),
|
||||
pass: z.string().default(''),
|
||||
headers: z.record(z.string(), z.string()).default({}),
|
||||
});
|
||||
export type HttpOutboundFormSettings = z.infer<typeof HttpOutboundFormSettingsSchema>;
|
||||
|
||||
|
||||
@@ -21,5 +21,6 @@ export type HttpOutboundServer = z.infer<typeof HttpOutboundServerSchema>;
|
||||
|
||||
export const HttpOutboundSettingsSchema = z.object({
|
||||
servers: z.array(HttpOutboundServerSchema).min(1),
|
||||
headers: z.record(z.string(), z.string()).optional(),
|
||||
});
|
||||
export type HttpOutboundSettings = z.infer<typeof HttpOutboundSettingsSchema>;
|
||||
|
||||
Reference in New Issue
Block a user