mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-07-25 13:56:10 +00:00
feat(mtproto): add domain-fronting and essential mtg options
Expose mtg's [domain-fronting] section (ip/port/proxy-protocol) plus proxy-protocol-listener, prefer-ip, and debug on MTProto inbounds. Each key is written to the generated mtg-<id>.toml only when set, so mtg's own defaults apply otherwise. The instance fingerprint now covers these fields, so editing an option restarts the sidecar. Since MTProto is mtg-served (not Xray), sniffing does not apply: hide the Sniffing tab and the Advanced sniffing sub-editor, drop it from the Advanced "All" JSON view, and emit empty sniffing in the wire payload, all gated by a new canEnableSniffing predicate.
This commit is contained in:
@@ -142,6 +142,17 @@ describe('formValuesToWirePayload', () => {
|
||||
expect(payload.streamSettings).toBe('');
|
||||
});
|
||||
|
||||
it('emits empty sniffing for mtproto (mtg-served, not Xray)', () => {
|
||||
const values = rawInboundToFormValues({
|
||||
...vlessRow,
|
||||
protocol: 'mtproto',
|
||||
settings: { fakeTlsDomain: 'www.cloudflare.com', secret: 'ee00' },
|
||||
});
|
||||
const payload = formValuesToWirePayload(values);
|
||||
expect(payload.protocol).toBe('mtproto');
|
||||
expect(payload.sniffing).toBe('');
|
||||
});
|
||||
|
||||
it('omits nodeId when null', () => {
|
||||
const values = rawInboundToFormValues({ ...vlessRow, nodeId: null });
|
||||
const payload = formValuesToWirePayload(values);
|
||||
|
||||
Reference in New Issue
Block a user