stream_finalmask.html 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {{define "form/streamFinalMask"}}
  2. <a-divider :style="{ margin: '5px 0 0' }"></a-divider>
  3. <a-form :colon="false" :label-col="{ md: {span:8} }"
  4. :wrapper-col="{ md: {span:14} }">
  5. <a-form-item label="UDP Masks">
  6. <a-button icon="plus" type="primary" size="small"
  7. @click="inbound.stream.addUdpMask(inbound.stream.network === 'kcp' ? 'mkcp-aes128gcm' : 'xdns')"></a-button>
  8. </a-form-item>
  9. <template
  10. v-if="inbound.stream.finalmask.udp && inbound.stream.finalmask.udp.length > 0">
  11. <a-form v-for="(mask, index) in inbound.stream.finalmask.udp"
  12. :key="index" :colon="false"
  13. :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }">
  14. <a-divider :style="{ margin: '0' }"> UDP Mask [[ index + 1 ]]
  15. <a-icon type="delete"
  16. @click="() => inbound.stream.delUdpMask(index)"
  17. :style="{ color: 'rgb(255, 77, 79)', cursor: 'pointer' }"></a-icon>
  18. </a-divider>
  19. <a-form-item label='Type'>
  20. <a-select v-model="mask.type"
  21. @change="(type) => mask.settings = mask._getDefaultSettings(type, {})"
  22. :dropdown-class-name="themeSwitcher.currentTheme">
  23. <!-- mKCP-specific masks -->
  24. <a-select-option v-if="inbound.stream.network === 'kcp'"
  25. value="mkcp-aes128gcm">
  26. mKCP AES-128-GCM</a-select-option>
  27. <a-select-option v-if="inbound.stream.network === 'kcp'"
  28. value="header-dns">
  29. Header DNS</a-select-option>
  30. <a-select-option v-if="inbound.stream.network === 'kcp'"
  31. value="header-dtls">
  32. Header DTLS 1.2</a-select-option>
  33. <a-select-option v-if="inbound.stream.network === 'kcp'"
  34. value="header-srtp">
  35. Header SRTP</a-select-option>
  36. <a-select-option v-if="inbound.stream.network === 'kcp'"
  37. value="header-utp">
  38. Header uTP</a-select-option>
  39. <a-select-option v-if="inbound.stream.network === 'kcp'"
  40. value="header-wechat">
  41. Header WeChat Video</a-select-option>
  42. <a-select-option v-if="inbound.stream.network === 'kcp'"
  43. value="header-wireguard">
  44. Header WireGuard</a-select-option>
  45. <a-select-option v-if="inbound.stream.network === 'kcp'"
  46. value="mkcp-original">
  47. mKCP Original</a-select-option>
  48. <!-- xDNS for TCP/WS/HTTPUpgrade/XHTTP -->
  49. <a-select-option
  50. v-if="['tcp', 'ws', 'httpupgrade', 'xhttp'].includes(inbound.stream.network)"
  51. value="xdns">
  52. xDNS (Experimental)</a-select-option>
  53. </a-select>
  54. </a-form-item>
  55. <!-- Settings for password-based masks -->
  56. <a-form-item label='Password'
  57. v-if="['mkcp-aes128gcm'].includes(mask.type)">
  58. <a-input v-model.trim="mask.settings.password"
  59. placeholder="Obfuscation password"></a-input>
  60. </a-form-item>
  61. <!-- Settings for domain-based masks -->
  62. <a-form-item label='Domain'
  63. v-if="['header-dns', 'xdns'].includes(mask.type)">
  64. <a-input v-model.trim="mask.settings.domain"
  65. placeholder="e.g., www.example.com"></a-input>
  66. </a-form-item>
  67. </a-form>
  68. </template>
  69. </a-form>
  70. {{end}}