stream_tcp.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. {{define "form/streamTCP"}}
  2. <!-- tcp type -->
  3. <a-form layout="inline">
  4. <a-form-item label="AcceptProxyProtocol">
  5. <a-switch v-model="inbound.stream.tcp.acceptProxyProtocol"></a-switch>
  6. </a-form-item>
  7. <a-form-item label='HTTP {{ i18n "camouflage" }}'>
  8. <a-switch
  9. :checked="inbound.stream.tcp.type === 'http'"
  10. @change="checked => inbound.stream.tcp.type = checked ? 'http' : 'none'">
  11. </a-switch>
  12. </a-form-item>
  13. </a-form>
  14. <!-- tcp request -->
  15. <a-form v-if="inbound.stream.tcp.type === 'http'" layout="inline">
  16. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.requestVersion" }}'>
  17. <a-input v-model.trim="inbound.stream.tcp.request.version"></a-input>
  18. </a-form-item>
  19. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.requestMethod" }}'>
  20. <a-input v-model.trim="inbound.stream.tcp.request.method"></a-input>
  21. </a-form-item>
  22. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.requestPath" }}'>
  23. <a-button size="small" @click="inbound.stream.tcp.request.addPath('/')">+</a-button>
  24. <a-row v-for="(path, index) in inbound.stream.tcp.request.path">
  25. <a-input v-model.trim="inbound.stream.tcp.request.path[index]" style="width: 200px;">
  26. <a-button size="small" slot="addonAfter"
  27. @click="inbound.stream.tcp.request.removePath(index)"
  28. v-if="inbound.stream.tcp.request.path.length>1">-</a-button>
  29. </a-input>
  30. </a-row>
  31. </a-form-item>
  32. <br>
  33. <a-form-item>
  34. <a-row>
  35. <span>{{ i18n "pages.inbounds.stream.general.requestHeader" }}:</span>
  36. <a-button type="primary" size="small" style="margin-left: 10px" @click="inbound.stream.tcp.request.addHeader('Host', 'xxx.com')">+</a-button>
  37. </a-row>
  38. <a-input-group v-for="(header, index) in inbound.stream.tcp.request.headers">
  39. <a-input style="width: 50%" v-model.trim="header.name"
  40. addon-before='{{ i18n "pages.inbounds.stream.general.name" }}'></a-input>
  41. <a-input style="width: 50%" v-model.trim="header.value"
  42. addon-before='{{ i18n "pages.inbounds.stream.general.value" }}'>
  43. <template slot="addonAfter">
  44. <a-button type="primary" size="small" style="margin-left: 10px" @click="inbound.stream.tcp.request.removeHeader(index)">-</a-button>
  45. </template>
  46. </a-input>
  47. </a-input-group>
  48. </a-form-item>
  49. </a-form>
  50. <!-- tcp response -->
  51. <a-form v-if="inbound.stream.tcp.type === 'http'" layout="inline">
  52. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseVersion" }}'>
  53. <a-input v-model.trim="inbound.stream.tcp.response.version"></a-input>
  54. </a-form-item>
  55. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseStatus" }}'>
  56. <a-input v-model.trim="inbound.stream.tcp.response.status"></a-input>
  57. </a-form-item>
  58. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseStatusDescription" }}'>
  59. <a-input v-model.trim="inbound.stream.tcp.response.reason"></a-input>
  60. </a-form-item>
  61. <a-form-item>
  62. <a-row>
  63. <span>{{ i18n "pages.inbounds.stream.tcp.responseHeader" }}:</span>
  64. <a-button type="primary" size="small" style="margin-left: 10px" @click="inbound.stream.tcp.response.addHeader('Content-Type', 'application/octet-stream')">+</a-button>
  65. </a-row>
  66. <a-input-group v-for="(header, index) in inbound.stream.tcp.response.headers">
  67. <a-input style="width: 50%" v-model.trim="header.name"
  68. addon-before='{{ i18n "pages.inbounds.stream.general.name" }}'></a-input>
  69. <a-input style="width: 50%" v-model.trim="header.value"
  70. addon-before='{{ i18n "pages.inbounds.stream.general.value" }}'>
  71. <template slot="addonAfter">
  72. <a-button type="primary" size="small" style="margin-left: 10px" @click="inbound.stream.tcp.response.removeHeader(index)">-</a-button>
  73. </template>
  74. </a-input>
  75. </a-input-group>
  76. </a-form-item>
  77. </a-form>
  78. {{end}}