stream_tcp.html 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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'"
  16. layout="inline">
  17. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.requestVersion" }}'>
  18. <a-input v-model.trim="inbound.stream.tcp.request.version"></a-input>
  19. </a-form-item>
  20. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.requestMethod" }}'>
  21. <a-input v-model.trim="inbound.stream.tcp.request.method"></a-input>
  22. </a-form-item>
  23. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.requestPath" }}'>
  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]"></a-input>
  26. </a-row>
  27. </a-form-item>
  28. <a-form-item label='{{ i18n "pages.inbounds.stream.general.requestHeader" }}'>
  29. <a-row>
  30. <a-button size="small"
  31. @click="inbound.stream.tcp.request.addHeader('Host', 'xxx.com')">
  32. +
  33. </a-button>
  34. </a-row>
  35. <a-input-group v-for="(header, index) in inbound.stream.tcp.request.headers">
  36. <a-input style="width: 50%" v-model.trim="header.name"
  37. addon-before='{{ i18n "pages.inbounds.stream.general.name" }}'></a-input>
  38. <a-input style="width: 50%" v-model.trim="header.value"
  39. addon-before='{{ i18n "pages.inbounds.stream.general.value" }}'>
  40. <template slot="addonAfter">
  41. <a-button size="small"
  42. @click="inbound.stream.tcp.request.removeHeader(index)">
  43. -
  44. </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'"
  52. layout="inline">
  53. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseVersion" }}'>
  54. <a-input v-model.trim="inbound.stream.tcp.response.version"></a-input>
  55. </a-form-item>
  56. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseStatus" }}'>
  57. <a-input v-model.trim="inbound.stream.tcp.response.status"></a-input>
  58. </a-form-item>
  59. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseStatusDescription" }}'>
  60. <a-input v-model.trim="inbound.stream.tcp.response.reason"></a-input>
  61. </a-form-item>
  62. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseHeader" }}'>
  63. <a-row>
  64. <a-button size="small"
  65. @click="inbound.stream.tcp.response.addHeader('Content-Type', 'application/octet-stream')">
  66. +
  67. </a-button>
  68. </a-row>
  69. <a-input-group v-for="(header, index) in inbound.stream.tcp.response.headers">
  70. <a-input style="width: 50%" v-model.trim="header.name"
  71. addon-before='{{ i18n "pages.inbounds.stream.general.name" }}'></a-input>
  72. <a-input style="width: 50%" v-model.trim="header.value"
  73. addon-before='{{ i18n "pages.inbounds.stream.general.value" }}'>
  74. <template slot="addonAfter">
  75. <a-button size="small"
  76. @click="inbound.stream.tcp.response.removeHeader(index)">
  77. -
  78. </a-button>
  79. </template>
  80. </a-input>
  81. </a-input-group>
  82. </a-form-item>
  83. </a-form>
  84. {{end}}