2023-02-09 22:18:06 +03:00
|
|
|
{{define "form/streamTCP"}}
|
|
|
|
<!-- tcp type -->
|
2023-12-13 18:57:36 +03:00
|
|
|
<a-form :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }">
|
2024-01-09 12:10:40 +03:00
|
|
|
<a-form-item label="PROXY Protocol" v-if="inbound.canEnableTls()">
|
2023-02-09 22:18:06 +03:00
|
|
|
<a-switch v-model="inbound.stream.tcp.acceptProxyProtocol"></a-switch>
|
|
|
|
</a-form-item>
|
2023-05-04 20:52:54 +03:00
|
|
|
<a-form-item label='HTTP {{ i18n "camouflage" }}'>
|
2023-02-09 22:18:06 +03:00
|
|
|
<a-switch
|
2023-12-13 18:57:36 +03:00
|
|
|
:checked="inbound.stream.tcp.type === 'http'"
|
|
|
|
@change="checked => inbound.stream.tcp.type = checked ? 'http' : 'none'">
|
2023-02-09 22:18:06 +03:00
|
|
|
</a-switch>
|
|
|
|
</a-form-item>
|
|
|
|
</a-form>
|
|
|
|
|
|
|
|
<!-- tcp request -->
|
2023-12-13 18:57:36 +03:00
|
|
|
<a-form v-if="inbound.stream.tcp.type === 'http'" :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }">
|
|
|
|
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.requestVersion" }}'>
|
|
|
|
<a-input v-model.trim="inbound.stream.tcp.request.version"></a-input>
|
|
|
|
</a-form-item>
|
|
|
|
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.requestMethod" }}'>
|
|
|
|
<a-input v-model.trim="inbound.stream.tcp.request.method"></a-input>
|
|
|
|
</a-form-item>
|
|
|
|
<a-form-item>
|
|
|
|
<template slot="label">{{ i18n "pages.inbounds.stream.tcp.requestPath" }}
|
|
|
|
<a-button size="small" @click="inbound.stream.tcp.request.addPath('/')">+</a-button>
|
|
|
|
</template>
|
|
|
|
<template v-for="(path, index) in inbound.stream.tcp.request.path">
|
|
|
|
<a-input v-model.trim="inbound.stream.tcp.request.path[index]">
|
|
|
|
<a-button size="small" slot="addonAfter"
|
|
|
|
@click="inbound.stream.tcp.request.removePath(index)"
|
|
|
|
v-if="inbound.stream.tcp.request.path.length>1">-</a-button>
|
|
|
|
</a-input>
|
|
|
|
</template>
|
|
|
|
</a-form-item>
|
|
|
|
<a-form-item label='{{ i18n "pages.inbounds.stream.general.requestHeader" }}'>
|
2023-12-23 22:49:10 +03:00
|
|
|
<a-button size="small" @click="inbound.stream.tcp.request.addHeader('host', '')">+</a-button>
|
2023-12-13 18:57:36 +03:00
|
|
|
</a-form-item>
|
|
|
|
<a-form-item :wrapper-col="{span:24}">
|
|
|
|
<a-input-group compact v-for="(header, index) in inbound.stream.tcp.request.headers">
|
|
|
|
<a-input style="width: 50%" v-model.trim="header.name" placeholder='{{ i18n "pages.inbounds.stream.general.name" }}'>
|
|
|
|
<template slot="addonBefore" style="margin: 0;">[[ index+1 ]]</template>
|
|
|
|
</a-input>
|
|
|
|
<a-input style="width: 50%" v-model.trim="header.value" placeholder='{{ i18n "pages.inbounds.stream.general.value" }}'>
|
|
|
|
<a-button slot="addonAfter" size="small" @click="inbound.stream.tcp.request.removeHeader(index)">-</a-button>
|
|
|
|
</a-input>
|
|
|
|
</a-input-group>
|
|
|
|
</a-form-item>
|
2023-12-09 18:18:06 +03:00
|
|
|
<!-- tcp response -->
|
2023-12-13 18:57:36 +03:00
|
|
|
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseVersion" }}'>
|
|
|
|
<a-input v-model.trim="inbound.stream.tcp.response.version"></a-input>
|
|
|
|
</a-form-item>
|
|
|
|
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseStatus" }}'>
|
|
|
|
<a-input v-model.trim="inbound.stream.tcp.response.status"></a-input>
|
|
|
|
</a-form-item>
|
|
|
|
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseStatusDescription" }}'>
|
|
|
|
<a-input v-model.trim="inbound.stream.tcp.response.reason"></a-input>
|
|
|
|
</a-form-item>
|
|
|
|
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseHeader" }}'>
|
|
|
|
<a-button size="small"
|
|
|
|
@click="inbound.stream.tcp.response.addHeader('Content-Type', 'application/octet-stream')">+</a-button>
|
|
|
|
</a-form-item>
|
|
|
|
<a-form-item :wrapper-col="{span:24}">
|
|
|
|
<a-input-group compact v-for="(header, index) in inbound.stream.tcp.response.headers">
|
|
|
|
<a-input style="width: 50%" v-model.trim="header.name" placeholder='{{ i18n "pages.inbounds.stream.general.name" }}'>
|
|
|
|
<template slot="addonBefore" style="margin: 0;">[[ index+1 ]]</template>
|
|
|
|
</a-input>
|
|
|
|
<a-input style="width: 50%" v-model.trim="header.value"
|
|
|
|
placeholder='{{ i18n "pages.inbounds.stream.general.value" }}'>
|
|
|
|
<template slot="addonAfter">
|
|
|
|
<a-button size="small" @click="inbound.stream.tcp.response.removeHeader(index)">-</a-button>
|
|
|
|
</template>
|
|
|
|
</a-input>
|
|
|
|
</a-input-group>
|
|
|
|
</a-form-item>
|
2023-02-09 22:18:06 +03:00
|
|
|
</a-form>
|
2024-01-09 12:10:40 +03:00
|
|
|
{{end}}
|