Bladeren bron

feat(frontend): outbound TCP HTTP camouflage parity with inbound

Add method/version inputs, request header map, and full response
sub-section (version/status/reason/headers) to OutboundFormModal so the
outbound side can configure the same HTTP-1.1 obfuscation knobs the
inbound side already exposed.
MHSanaei 7 uur geleden
bovenliggende
commit
9f84859ff6
1 gewijzigde bestanden met toevoegingen van 70 en 7 verwijderingen
  1. 70 7
      frontend/src/pages/xray/OutboundFormModal.tsx

+ 70 - 7
frontend/src/pages/xray/OutboundFormModal.tsx

@@ -1136,7 +1136,12 @@ export default function OutboundFormModal({
                                                   path: ['/'],
                                                   headers: {},
                                                 },
-                                                response: undefined,
+                                                response: {
+                                                  version: '1.1',
+                                                  status: '200',
+                                                  reason: 'OK',
+                                                  headers: {},
+                                                },
                                               }
                                             : { type: 'none' },
                                         )
@@ -1145,12 +1150,24 @@ export default function OutboundFormModal({
                                   </Form.Item>
                                   {type === 'http' && (
                                     <>
-                                      {/* Host is stored as a string[] on the
-                                          wire (V2 header map: { Host: [...] }).
-                                          The form-level normalize/getValueProps
-                                          translate to/from a comma-joined input
-                                          so the user types one Host:contentReference[oaicite:0]{index=0} value per
-                                          server they want camouflaged. */}
+                                      <Form.Item
+                                        label="Request method"
+                                        name={[
+                                          'streamSettings', 'tcpSettings', 'header',
+                                          'request', 'method',
+                                        ]}
+                                      >
+                                        <Input placeholder="GET" />
+                                      </Form.Item>
+                                      <Form.Item
+                                        label="Request version"
+                                        name={[
+                                          'streamSettings', 'tcpSettings', 'header',
+                                          'request', 'version',
+                                        ]}
+                                      >
+                                        <Input placeholder="1.1" />
+                                      </Form.Item>
                                       <Form.Item
                                         label={t('host')}
                                         name={[
@@ -1192,6 +1209,52 @@ export default function OutboundFormModal({
                                       >
                                         <Input placeholder="/,/api,/static" />
                                       </Form.Item>
+                                      <Form.Item
+                                        label="Request headers"
+                                        name={[
+                                          'streamSettings', 'tcpSettings', 'header',
+                                          'request', 'headers',
+                                        ]}
+                                      >
+                                        <HeaderMapEditor mode="v2" />
+                                      </Form.Item>
+
+                                      <Form.Item
+                                        label="Response version"
+                                        name={[
+                                          'streamSettings', 'tcpSettings', 'header',
+                                          'response', 'version',
+                                        ]}
+                                      >
+                                        <Input placeholder="1.1" />
+                                      </Form.Item>
+                                      <Form.Item
+                                        label="Response status"
+                                        name={[
+                                          'streamSettings', 'tcpSettings', 'header',
+                                          'response', 'status',
+                                        ]}
+                                      >
+                                        <Input placeholder="200" />
+                                      </Form.Item>
+                                      <Form.Item
+                                        label="Response reason"
+                                        name={[
+                                          'streamSettings', 'tcpSettings', 'header',
+                                          'response', 'reason',
+                                        ]}
+                                      >
+                                        <Input placeholder="OK" />
+                                      </Form.Item>
+                                      <Form.Item
+                                        label="Response headers"
+                                        name={[
+                                          'streamSettings', 'tcpSettings', 'header',
+                                          'response', 'headers',
+                                        ]}
+                                      >
+                                        <HeaderMapEditor mode="v2" />
+                                      </Form.Item>
                                     </>
                                   )}
                                 </>