stream_tcp.html 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 :checked="inbound.stream.tcp.type === 'http'"
  9. @change="checked => inbound.stream.tcp.type = checked ? 'http' : 'none'">
  10. </a-switch>
  11. </a-form-item>
  12. </a-form>
  13. <a-form v-if="inbound.stream.tcp.type === 'http'" :colon="false" :label-col="{ md: {span:8} }"
  14. :wrapper-col="{ md: {span:14} }">
  15. <!-- tcp request -->
  16. <a-divider style="margin:0;">{{ i18n "pages.inbounds.stream.general.request" }}</a-divider>
  17. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.version" }}'>
  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.method" }}'>
  21. <a-input v-model.trim="inbound.stream.tcp.request.method"></a-input>
  22. </a-form-item>
  23. <a-form-item>
  24. <template slot="label">{{ i18n "pages.inbounds.stream.tcp.path" }}
  25. <a-button size="small" @click="inbound.stream.tcp.request.addPath('/')">+</a-button>
  26. </template>
  27. <template v-for="(path, index) in inbound.stream.tcp.request.path">
  28. <a-input v-model.trim="inbound.stream.tcp.request.path[index]">
  29. <a-button size="small" slot="addonAfter" @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.tcp.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"
  40. placeholder='{{ i18n "pages.inbounds.stream.general.name" }}'>
  41. <template slot="addonBefore" style="margin: 0;">[[ index+1 ]]</template>
  42. </a-input>
  43. <a-input style="width: 50%" v-model.trim="header.value"
  44. placeholder='{{ i18n "pages.inbounds.stream.general.value" }}'>
  45. <a-button slot="addonAfter" size="small"
  46. @click="inbound.stream.tcp.request.removeHeader(index)">-</a-button>
  47. </a-input>
  48. </a-input-group>
  49. </a-form-item>
  50. <!-- tcp response -->
  51. <a-divider style="margin:0;">{{ i18n "pages.inbounds.stream.general.response" }}</a-divider>
  52. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.version" }}'>
  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.status" }}'>
  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.statusDescription" }}'>
  59. <a-input v-model.trim="inbound.stream.tcp.response.reason"></a-input>
  60. </a-form-item>
  61. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseHeader" }}'>
  62. <a-button size="small"
  63. @click="inbound.stream.tcp.response.addHeader('Content-Type', 'application/octet-stream')">+</a-button>
  64. </a-form-item>
  65. <a-form-item :wrapper-col="{span:24}">
  66. <a-input-group compact v-for="(header, index) in inbound.stream.tcp.response.headers">
  67. <a-input style="width: 50%" v-model.trim="header.name"
  68. placeholder='{{ i18n "pages.inbounds.stream.general.name" }}'>
  69. <template slot="addonBefore" style="margin: 0;">[[ index+1 ]]</template>
  70. </a-input>
  71. <a-input style="width: 50%" v-model.trim="header.value"
  72. placeholder='{{ i18n "pages.inbounds.stream.general.value" }}'>
  73. <template slot="addonAfter">
  74. <a-button size="small" @click="inbound.stream.tcp.response.removeHeader(index)">-</a-button>
  75. </template>
  76. </a-input>
  77. </a-input-group>
  78. </a-form-item>
  79. </a-form>
  80. {{end}}