stream_tcp.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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'" @change="checked => inbound.stream.tcp.type = checked ? 'http' : 'none'"></a-switch>
  9. </a-form-item>
  10. </a-form>
  11. <a-form v-if="inbound.stream.tcp.type === 'http'" :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }">
  12. <!-- tcp request -->
  13. <a-divider style="margin:0;">{{ i18n "pages.inbounds.stream.general.request" }}</a-divider>
  14. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.version" }}'>
  15. <a-input v-model.trim="inbound.stream.tcp.request.version"></a-input>
  16. </a-form-item>
  17. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.method" }}'>
  18. <a-input v-model.trim="inbound.stream.tcp.request.method"></a-input>
  19. </a-form-item>
  20. <a-form-item>
  21. <template slot="label">{{ i18n "pages.inbounds.stream.tcp.path" }}
  22. <a-button icon="plus" size="small" @click="inbound.stream.tcp.request.addPath('/')"></a-button>
  23. </template>
  24. <template v-for="(path, index) in inbound.stream.tcp.request.path">
  25. <a-input v-model.trim="inbound.stream.tcp.request.path[index]">
  26. <a-button icon="minus" size="small" slot="addonAfter" @click="inbound.stream.tcp.request.removePath(index)" v-if="inbound.stream.tcp.request.path.length>1"></a-button>
  27. </a-input>
  28. </template>
  29. </a-form-item>
  30. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.requestHeader" }}'>
  31. <a-button icon="plus" size="small" @click="inbound.stream.tcp.request.addHeader('Host', '')"></a-button>
  32. </a-form-item>
  33. <a-form-item :wrapper-col="{span:24}">
  34. <a-input-group compact v-for="(header, index) in inbound.stream.tcp.request.headers">
  35. <a-input style="width: 50%" v-model.trim="header.name" placeholder='{{ i18n "pages.inbounds.stream.general.name" }}'>
  36. <template slot="addonBefore" style="margin: 0;">[[ index+1 ]]</template>
  37. </a-input>
  38. <a-input style="width: 50%" v-model.trim="header.value" placeholder='{{ i18n "pages.inbounds.stream.general.value" }}'>
  39. <a-button icon="minus" slot="addonAfter" size="small" @click="inbound.stream.tcp.request.removeHeader(index)"></a-button>
  40. </a-input>
  41. </a-input-group>
  42. </a-form-item>
  43. <!-- tcp response -->
  44. <a-divider style="margin:0;">{{ i18n "pages.inbounds.stream.general.response" }}</a-divider>
  45. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.version" }}'>
  46. <a-input v-model.trim="inbound.stream.tcp.response.version"></a-input>
  47. </a-form-item>
  48. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.status" }}'>
  49. <a-input v-model.trim="inbound.stream.tcp.response.status"></a-input>
  50. </a-form-item>
  51. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.statusDescription" }}'>
  52. <a-input v-model.trim="inbound.stream.tcp.response.reason"></a-input>
  53. </a-form-item>
  54. <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseHeader" }}'>
  55. <a-button icon="plus" size="small" @click="inbound.stream.tcp.response.addHeader('Content-Type', 'application/octet-stream')"></a-button>
  56. </a-form-item>
  57. <a-form-item :wrapper-col="{span:24}">
  58. <a-input-group compact v-for="(header, index) in inbound.stream.tcp.response.headers">
  59. <a-input style="width: 50%" v-model.trim="header.name" placeholder='{{ i18n "pages.inbounds.stream.general.name" }}'>
  60. <template slot="addonBefore" style="margin: 0;">[[ index+1 ]]</template>
  61. </a-input>
  62. <a-input style="width: 50%" v-model.trim="header.value" placeholder='{{ i18n "pages.inbounds.stream.general.value" }}'>
  63. <template slot="addonAfter">
  64. <a-button icon="minus" size="small" @click="inbound.stream.tcp.response.removeHeader(index)"></a-button>
  65. </template>
  66. </a-input>
  67. </a-input-group>
  68. </a-form-item>
  69. </a-form>
  70. {{end}}