stream_tcp.html 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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-row v-for="(path, index) in inbound.stream.tcp.request.path">
  24. <a-input v-model.trim="inbound.stream.tcp.request.path[index]"></a-input>
  25. </a-row>
  26. </a-form-item>
  27. <br>
  28. <a-form-item>
  29. <a-row>
  30. <span>{{ i18n "pages.inbounds.stream.general.requestHeader" }}:</span>
  31. <a-button type="primary" size="small" style="margin-left: 10px" @click="inbound.stream.tcp.request.addHeader('Host', 'xxx.com')">+</a-button>
  32. </a-row>
  33. <a-input-group v-for="(header, index) in inbound.stream.tcp.request.headers">
  34. <a-input style="width: 50%" v-model.trim="header.name"
  35. addon-before='{{ i18n "pages.inbounds.stream.general.name" }}'></a-input>
  36. <a-input style="width: 50%" v-model.trim="header.value"
  37. addon-before='{{ i18n "pages.inbounds.stream.general.value" }}'>
  38. <template slot="addonAfter">
  39. <a-button type="primary" size="small" style="margin-left: 10px" @click="inbound.stream.tcp.request.removeHeader(index)">-</a-button>
  40. </template>
  41. </a-input>
  42. </a-input-group>
  43. </a-form-item>
  44. </a-form>
  45. <!-- tcp response -->
  46. <a-form v-if="inbound.stream.tcp.type === 'http'" layout="inline">
  47. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseVersion" }}'>
  48. <a-input v-model.trim="inbound.stream.tcp.response.version"></a-input>
  49. </a-form-item>
  50. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseStatus" }}'>
  51. <a-input v-model.trim="inbound.stream.tcp.response.status"></a-input>
  52. </a-form-item>
  53. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseStatusDescription" }}'>
  54. <a-input v-model.trim="inbound.stream.tcp.response.reason"></a-input>
  55. </a-form-item>
  56. <a-form-item>
  57. <a-row>
  58. <span>{{ i18n "pages.inbounds.stream.tcp.responseHeader" }}:</span>
  59. <a-button type="primary" size="small" style="margin-left: 10px" @click="inbound.stream.tcp.response.addHeader('Content-Type', 'application/octet-stream')">+</a-button>
  60. </a-row>
  61. <a-input-group v-for="(header, index) in inbound.stream.tcp.response.headers">
  62. <a-input style="width: 50%" v-model.trim="header.name"
  63. addon-before='{{ i18n "pages.inbounds.stream.general.name" }}'></a-input>
  64. <a-input style="width: 50%" v-model.trim="header.value"
  65. addon-before='{{ i18n "pages.inbounds.stream.general.value" }}'>
  66. <template slot="addonAfter">
  67. <a-button type="primary" size="small" style="margin-left: 10px" @click="inbound.stream.tcp.response.removeHeader(index)">-</a-button>
  68. </template>
  69. </a-input>
  70. </a-input-group>
  71. </a-form-item>
  72. </a-form>
  73. {{end}}