stream_tcp.html 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. {{define "form/streamTCP"}}
  2. <!-- tcp type -->
  3. <a-form :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }">
  4. <a-form-item label="PROXY Protocol" v-if="inbound.canEnableTls()">
  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'" :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }">
  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>
  23. <template slot="label">{{ i18n "pages.inbounds.stream.tcp.requestPath" }}
  24. <a-button size="small" @click="inbound.stream.tcp.request.addPath('/')">+</a-button>
  25. </template>
  26. <template v-for="(path, index) in inbound.stream.tcp.request.path">
  27. <a-input v-model.trim="inbound.stream.tcp.request.path[index]">
  28. <a-button size="small" slot="addonAfter"
  29. @click="inbound.stream.tcp.request.removePath(index)"
  30. v-if="inbound.stream.tcp.request.path.length>1">-</a-button>
  31. </a-input>
  32. </template>
  33. </a-form-item>
  34. <a-form-item label='{{ i18n "pages.inbounds.stream.general.requestHeader" }}'>
  35. <a-button size="small" @click="inbound.stream.tcp.request.addHeader('host', '')">+</a-button>
  36. </a-form-item>
  37. <a-form-item :wrapper-col="{span:24}">
  38. <a-input-group compact v-for="(header, index) in inbound.stream.tcp.request.headers">
  39. <a-input style="width: 50%" v-model.trim="header.name" placeholder='{{ i18n "pages.inbounds.stream.general.name" }}'>
  40. <template slot="addonBefore" style="margin: 0;">[[ index+1 ]]</template>
  41. </a-input>
  42. <a-input style="width: 50%" v-model.trim="header.value" placeholder='{{ i18n "pages.inbounds.stream.general.value" }}'>
  43. <a-button slot="addonAfter" size="small" @click="inbound.stream.tcp.request.removeHeader(index)">-</a-button>
  44. </a-input>
  45. </a-input-group>
  46. </a-form-item>
  47. <!-- tcp response -->
  48. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseVersion" }}'>
  49. <a-input v-model.trim="inbound.stream.tcp.response.version"></a-input>
  50. </a-form-item>
  51. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseStatus" }}'>
  52. <a-input v-model.trim="inbound.stream.tcp.response.status"></a-input>
  53. </a-form-item>
  54. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseStatusDescription" }}'>
  55. <a-input v-model.trim="inbound.stream.tcp.response.reason"></a-input>
  56. </a-form-item>
  57. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseHeader" }}'>
  58. <a-button size="small"
  59. @click="inbound.stream.tcp.response.addHeader('Content-Type', 'application/octet-stream')">+</a-button>
  60. </a-form-item>
  61. <a-form-item :wrapper-col="{span:24}">
  62. <a-input-group compact v-for="(header, index) in inbound.stream.tcp.response.headers">
  63. <a-input style="width: 50%" v-model.trim="header.name" placeholder='{{ i18n "pages.inbounds.stream.general.name" }}'>
  64. <template slot="addonBefore" style="margin: 0;">[[ index+1 ]]</template>
  65. </a-input>
  66. <a-input style="width: 50%" v-model.trim="header.value"
  67. placeholder='{{ i18n "pages.inbounds.stream.general.value" }}'>
  68. <template slot="addonAfter">
  69. <a-button size="small" @click="inbound.stream.tcp.response.removeHeader(index)">-</a-button>
  70. </template>
  71. </a-input>
  72. </a-input-group>
  73. </a-form-item>
  74. </a-form>
  75. {{end}}