1
0

stream_tcp.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. {{define "form/streamTCP"}}
  2. <!-- tcp type -->
  3. <a-form
  4. :colon="false"
  5. :label-col="{ md: {span:8} }"
  6. :wrapper-col="{ md: {span:14} }"
  7. >
  8. <a-form-item label="Proxy Protocol" v-if="inbound.canEnableTls()">
  9. <a-switch v-model="inbound.stream.tcp.acceptProxyProtocol"></a-switch>
  10. </a-form-item>
  11. <a-form-item label='HTTP {{ i18n "camouflage" }}'>
  12. <a-switch
  13. :checked="inbound.stream.tcp.type === 'http'"
  14. @change="checked => inbound.stream.tcp.type = checked ? 'http' : 'none'"
  15. ></a-switch>
  16. </a-form-item>
  17. </a-form>
  18. <a-form
  19. v-if="inbound.stream.tcp.type === 'http'"
  20. :colon="false"
  21. :label-col="{ md: {span:8} }"
  22. :wrapper-col="{ md: {span:14} }"
  23. >
  24. <!-- tcp request -->
  25. <a-divider :style="{ margin: '0' }"
  26. >{{ i18n "pages.inbounds.stream.general.request" }}</a-divider
  27. >
  28. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.version" }}'>
  29. <a-input v-model.trim="inbound.stream.tcp.request.version"></a-input>
  30. </a-form-item>
  31. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.method" }}'>
  32. <a-input v-model.trim="inbound.stream.tcp.request.method"></a-input>
  33. </a-form-item>
  34. <a-form-item>
  35. <template slot="label"
  36. >{{ i18n "pages.inbounds.stream.tcp.path" }}
  37. <a-button
  38. icon="plus"
  39. size="small"
  40. @click="inbound.stream.tcp.request.addPath('/')"
  41. ></a-button>
  42. </template>
  43. <template v-for="(path, index) in inbound.stream.tcp.request.path">
  44. <a-input v-model.trim="inbound.stream.tcp.request.path[index]">
  45. <a-button
  46. icon="minus"
  47. size="small"
  48. slot="addonAfter"
  49. @click="inbound.stream.tcp.request.removePath(index)"
  50. v-if="inbound.stream.tcp.request.path.length>1"
  51. ></a-button>
  52. </a-input>
  53. </template>
  54. </a-form-item>
  55. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.requestHeader" }}'>
  56. <a-button
  57. icon="plus"
  58. size="small"
  59. @click="inbound.stream.tcp.request.addHeader('Host', '')"
  60. ></a-button>
  61. </a-form-item>
  62. <a-form-item :wrapper-col="{span:24}">
  63. <a-input-group
  64. compact
  65. v-for="(header, index) in inbound.stream.tcp.request.headers"
  66. >
  67. <a-input
  68. :style="{ width: '50%' }"
  69. v-model.trim="header.name"
  70. placeholder='{{ i18n "pages.inbounds.stream.general.name" }}'
  71. >
  72. <template slot="addonBefore" :style="{ margin: '0' }"
  73. >[[ index+1 ]]</template
  74. >
  75. </a-input>
  76. <a-input
  77. :style="{ width: '50%' }"
  78. v-model.trim="header.value"
  79. placeholder='{{ i18n "pages.inbounds.stream.general.value" }}'
  80. >
  81. <a-button
  82. icon="minus"
  83. slot="addonAfter"
  84. size="small"
  85. @click="inbound.stream.tcp.request.removeHeader(index)"
  86. ></a-button>
  87. </a-input>
  88. </a-input-group>
  89. </a-form-item>
  90. <!-- tcp response -->
  91. <a-divider :style="{ margin: '0' }"
  92. >{{ i18n "pages.inbounds.stream.general.response" }}</a-divider
  93. >
  94. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.version" }}'>
  95. <a-input v-model.trim="inbound.stream.tcp.response.version"></a-input>
  96. </a-form-item>
  97. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.status" }}'>
  98. <a-input v-model.trim="inbound.stream.tcp.response.status"></a-input>
  99. </a-form-item>
  100. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.statusDescription" }}'>
  101. <a-input v-model.trim="inbound.stream.tcp.response.reason"></a-input>
  102. </a-form-item>
  103. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseHeader" }}'>
  104. <a-button
  105. icon="plus"
  106. size="small"
  107. @click="inbound.stream.tcp.response.addHeader('Content-Type', 'application/octet-stream')"
  108. ></a-button>
  109. </a-form-item>
  110. <a-form-item :wrapper-col="{span:24}">
  111. <a-input-group
  112. compact
  113. v-for="(header, index) in inbound.stream.tcp.response.headers"
  114. >
  115. <a-input
  116. :style="{ width: '50%' }"
  117. v-model.trim="header.name"
  118. placeholder='{{ i18n "pages.inbounds.stream.general.name" }}'
  119. >
  120. <template slot="addonBefore" :style="{ margin: '0' }"
  121. >[[ index+1 ]]</template
  122. >
  123. </a-input>
  124. <a-input
  125. :style="{ width: '50%' }"
  126. v-model.trim="header.value"
  127. placeholder='{{ i18n "pages.inbounds.stream.general.value" }}'
  128. >
  129. <template slot="addonAfter">
  130. <a-button
  131. icon="minus"
  132. size="small"
  133. @click="inbound.stream.tcp.response.removeHeader(index)"
  134. ></a-button>
  135. </template>
  136. </a-input>
  137. </a-input-group>
  138. </a-form-item>
  139. </a-form>
  140. {{end}}