stream_tcp.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. {{define "form/streamTCP"}}
  2. <!-- tcp type -->
  3. <a-form layout="inline">
  4. <a-form-item label="Accept 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'" layout="inline">
  16. <table width="100%" class="ant-table-tbody">
  17. <tr>
  18. <td>{{ i18n "pages.inbounds.stream.tcp.requestVersion" }}</td>
  19. <td>
  20. <a-form-item>
  21. <a-input v-model.trim="inbound.stream.tcp.request.version" style="width: 200px;"></a-input>
  22. </a-form-item>
  23. </td>
  24. </tr>
  25. <tr>
  26. <td>{{ i18n "pages.inbounds.stream.tcp.requestMethod" }}</td>
  27. <td>
  28. <a-form-item>
  29. <a-input v-model.trim="inbound.stream.tcp.request.method" style="width: 200px;"></a-input>
  30. </a-form-item>
  31. </td>
  32. </tr>
  33. <tr>
  34. <td style="vertical-align: top; padding-top: 10px;">{{ i18n "pages.inbounds.stream.tcp.requestPath" }}
  35. <a-button size="small" @click="inbound.stream.tcp.request.addPath('/')">+</a-button>
  36. </td>
  37. <td>
  38. <a-form-item>
  39. <a-row v-for="(path, index) in inbound.stream.tcp.request.path">
  40. <a-input v-model.trim="inbound.stream.tcp.request.path[index]" style="width: 200px;">
  41. <a-button size="small" slot="addonAfter"
  42. @click="inbound.stream.tcp.request.removePath(index)"
  43. v-if="inbound.stream.tcp.request.path.length>1">-</a-button>
  44. </a-input>
  45. </a-row>
  46. </a-form-item>
  47. </td>
  48. </tr>
  49. <tr>
  50. <td colspan="2" width="100%">
  51. <a-form-item>
  52. <span>{{ i18n "pages.inbounds.stream.general.requestHeader" }}:</span>
  53. <a-button size="small" style="margin-left: 10px" @click="inbound.stream.tcp.request.addHeader('', '')">+</a-button>
  54. <a-input-group compact v-for="(header, index) in inbound.stream.tcp.request.headers">
  55. <a-input style="width: 50%" v-model.trim="header.name" placeholder='{{ i18n "pages.inbounds.stream.general.name" }}'>
  56. <template slot="addonBefore" style="margin: 0;">[[ index+1 ]]</template>
  57. </a-input>
  58. <a-input style="width: 50%" v-model.trim="header.value" placeholder='{{ i18n "pages.inbounds.stream.general.value" }}'>
  59. <a-button slot="addonAfter" size="small" @click="inbound.stream.tcp.request.removeHeader(index)">-</a-button>
  60. </a-input>
  61. </a-input-group>
  62. </a-form-item>
  63. </td>
  64. </tr>
  65. <!-- tcp response -->
  66. <tr>
  67. <td>{{ i18n "pages.inbounds.stream.tcp.responseVersion" }}</td>
  68. <td>
  69. <a-form-item>
  70. <a-input v-model.trim="inbound.stream.tcp.response.version" style="width: 200px;"></a-input>
  71. </a-form-item>
  72. </td>
  73. </tr>
  74. <tr>
  75. <td>{{ i18n "pages.inbounds.stream.tcp.responseStatus" }}</td>
  76. <td>
  77. <a-form-item>
  78. <a-input v-model.trim="inbound.stream.tcp.response.status" style="width: 200px;"></a-input>
  79. </a-form-item>
  80. </td>
  81. </tr>
  82. <tr>
  83. <td>{{ i18n "pages.inbounds.stream.tcp.responseStatusDescription" }}</td>
  84. <td>
  85. <a-form-item>
  86. <a-input v-model.trim="inbound.stream.tcp.response.reason" style="width: 200px;"></a-input>
  87. </a-form-item>
  88. </td>
  89. </tr>
  90. <tr>
  91. <td colspan="2" width="100%">
  92. <a-form-item>
  93. <span>{{ i18n "pages.inbounds.stream.tcp.responseHeader" }}:</span>
  94. <a-button size="small" style="margin-left: 10px"
  95. @click="inbound.stream.tcp.response.addHeader('Content-Type', 'application/octet-stream')">+</a-button>
  96. <a-input-group compact v-for="(header, index) in inbound.stream.tcp.response.headers">
  97. <a-input style="width: 50%" v-model.trim="header.name" placeholder='{{ i18n "pages.inbounds.stream.general.name" }}'>
  98. <template slot="addonBefore" style="margin: 0;">[[ index+1 ]]</template>
  99. </a-input>
  100. <a-input style="width: 50%" v-model.trim="header.value"
  101. placeholder='{{ i18n "pages.inbounds.stream.general.value" }}'>
  102. <template slot="addonAfter">
  103. <a-button size="small" @click="inbound.stream.tcp.response.removeHeader(index)">-</a-button>
  104. </template>
  105. </a-input>
  106. </a-input-group>
  107. </a-form-item>
  108. </td>
  109. </tr>
  110. </table>
  111. </a-form>
  112. {{end}}