stream_tcp.html 3.7 KB

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