| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544 | {{define "form/outbound"}}<!-- base --><a-tabs :active-key="outModal.activeKey"  style="padding: 0; background-color: transparent;" @change="(activeKey) => {outModal.toggleJson(activeKey == '2'); }"><a-tab-pane key="1" tab="Form"><a-form layout="inline">    <table width="100%" class="ant-table-tbody">        <tr>            <td>{{ i18n "protocol" }}</td>            <td>                <a-form-item>                    <a-select v-model="outbound.protocol" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">                        <a-select-option v-for="x,y in Protocols" :value="x">[[ y ]]</a-select-option>                    </a-select>                </a-form-item>            </td>        </tr>        <tr>            <td>{{ i18n "pages.xray.outbound.tag" }}</td>            <td>                <a-form-item has-feedback :validate-status="outModal.duplicateTag? 'warning' : 'success'">                    <a-input v-model.trim="outbound.tag" style="width: 250px" @change="outModal.check()" placeholder='{{ i18n "pages.xray.outbound.tagDesc" }}'></a-input>                </a-form-item>            </td>        </tr><!-- freedom settings--><template v-if="outbound.protocol === Protocols.Freedom">        <tr>            <td>Strategy</td>            <td>                <a-form-item>                    <a-select                    v-model="outbound.settings.domainStrategy"                    style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">                        <a-select-option v-for="s in outboundDomainStrategies" :value="s">[[ s ]]</a-select-option>                    </a-select>                </a-form-item>            </td>        </tr>        <tr>            <td>Fragment</td>            <td>                <a-form-item>                    <a-switch                        :checked="Object.keys(outbound.settings.fragment).length >0"                        @change="checked => outbound.settings.fragment = checked ? new Outbound.FreedomSettings.Fragment() : {}">                    </a-switch>                </a-form-item>            </td>        </tr>    <template v-if="Object.keys(outbound.settings.fragment).length >0">        <tr>            <td>Packets</td>            <td>                <a-form-item>                    <a-select                    v-model="outbound.settings.fragment.packets"                    style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">                        <a-select-option v-for="s in ['1-3','tlshello']" :value="s">[[ s ]]</a-select-option>                    </a-select>                </a-form-item>            </td>        </tr>        <tr>            <td>Length</td>            <td>                <a-form-item>                    <a-input v-model.trim="outbound.settings.fragment.length" style="width: 250px"></a-input>                </a-form-item>            </td>        </tr>        <tr>            <td>Interval</td>            <td>                <a-form-item>                    <a-input v-model.trim="outbound.settings.fragment.interval" style="width: 250px"></a-input>                </a-form-item>            </td>        </tr>    </template></template><!-- blackhole settings --><template v-if="outbound.protocol === Protocols.Blackhole">        <tr>            <td>Response Type</td>            <td>                <a-form-item>                    <a-select                    v-model="outbound.settings.type"                    style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">                        <a-select-option v-for="s in ['', 'none','http']" :value="s">[[ s ]]</a-select-option>                    </a-select>                </a-form-item>            </td>        </tr></template><!-- dns settings --><template v-if="outbound.protocol === Protocols.DNS">        <tr>            <td>{{ i18n "pages.inbounds.network" }}</td>            <td>                <a-form-item>                    <a-select                    v-model="outbound.settings.network"                    style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">                        <a-select-option v-for="s in ['udp','tcp']" :value="s">[[ s ]]</a-select-option>                    </a-select>                </a-form-item>            </td>        </tr></template><!-- Address + Port --><template v-if="outbound.hasAddressPort()">        <tr>            <td>{{ i18n "pages.inbounds.address" }}</td>            <td>                <a-form-item>                    <a-input v-model.trim="outbound.settings.address" style="width: 250px"></a-input>                </a-form-item>            </td>        </tr>        <tr>            <td>{{ i18n "pages.inbounds.port" }}</td>            <td>                <a-form-item>                    <a-input-number v-model.number="outbound.settings.port" :min="1" :max="65532"></a-input-number>                </a-form-item>            </td>        </tr></template><!-- Vnext (vless/vmess) settings --><template v-if="[Protocols.VMess, Protocols.VLESS].includes(outbound.protocol)">        <tr>            <td>ID</td>            <td>                <a-form-item>                    <a-input v-model.trim="outbound.settings.id" style="width: 250px"></a-input>                </a-form-item>            </td>        </tr>    <!-- vless settings -->    <template v-if="outbound.canEnableTlsFlow()">        <tr>            <td>Flow</td>            <td>                <a-form-item>                    <a-select v-model="outbound.settings.flow" style="width: 250px" :dropdown-class-name="themeSwitcher.currentTheme">                        <a-select-option value="" selected>{{ i18n "none" }}</a-select-option>                        <a-select-option v-for="key in TLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option>                    </a-select>                </a-form-item>            </td>        </tr>    </template></template><!-- Servers (trojan/shadowsocks/socks/http) settings --><template v-if="outbound.hasServers()">        <tr v-if="outbound.hasUsername()">            <td>{{ i18n "username" }}</td>            <td>                <a-form-item>                    <a-input v-model.trim="outbound.settings.user" style="width: 250px"></a-input>                </a-form-item>            </td>        </tr>        <tr>            <td>{{ i18n "password" }}</td>            <td>                <a-form-item>                    <a-input v-model.trim="outbound.settings.password" style="width: 250px"></a-input>                </a-form-item>            </td>        </tr>    <!-- shadowsocks -->    <template v-if="outbound.protocol === Protocols.Shadowsocks">        <tr>            <td>{{ i18n "encryption" }}</td>            <td>                <a-form-item>                    <a-select v-model="outbound.settings.method" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">                        <a-select-option v-for="method in SSMethods" :value="method">[[ method ]]</a-select-option>                    </a-select>                </a-form-item>            </td>        </tr>        <tr>            <td>UDP over TCP</td>            <td>                <a-form-item>                    <a-switch v-model="outbound.settings.uot"></a-switch>                </a-form-item>            </td>        </tr>    </template></template><!-- stream settings --><template v-if="outbound.canEnableStream()">        <tr>            <td>{{ i18n "transmission" }}</td>            <td>                <a-form-item>                    <a-select v-model="outbound.stream.network" @change="streamNetworkChange"                    style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">                        <a-select-option value="tcp">TCP</a-select-option>                        <a-select-option value="kcp">KCP</a-select-option>                        <a-select-option value="ws">WebSocket</a-select-option>                        <a-select-option value="http">HTTP2</a-select-option>                        <a-select-option value="quic">QUIC</a-select-option>                        <a-select-option value="grpc">gRPC</a-select-option>                    </a-select>                </a-form-item>            </td>        </tr>    <template v-if="outbound.stream.network === 'tcp'">        <tr>            <td>http {{ i18n "camouflage" }}</td>            <td>                <a-form-item>                    <a-switch                            :checked="outbound.stream.tcp.type === 'http'"                            @change="checked => outbound.stream.tcp.type = checked ? 'http' : 'none'">                    </a-switch>                </a-form-item>            </td>        </tr>        <template v-if="outbound.stream.tcp.type == 'http'">        <tr>            <td>{{ i18n "host" }}</td>            <td>                <a-form-item>                    <a-input style="width: 250px;" v-model.trim="outbound.stream.tcp.host"></a-input>                </a-form-item>             </td>        </tr>        <tr>            <td>{{ i18n "path" }}</td>            <td>                <a-form-item>                    <a-input style="width: 250px;" v-model.trim="outbound.stream.tcp.path"></a-input>                </a-form-item>             </td>        </tr>        </template>    </template>        <!-- kcp -->    <template v-if="outbound.stream.network === 'kcp'">        <tr>            <td>{{ i18n "camouflage" }}</td>            <td>                <a-form-item>                    <a-select v-model="outbound.stream.kcp.type" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">                        <a-select-option value="none">none (not camouflage)</a-select-option>                        <a-select-option value="srtp">srtp (video call)</a-select-option>                        <a-select-option value="utp">utp (BT download)</a-select-option>                        <a-select-option value="wechat-video">wechat-video (WeChat video)</a-select-option>                        <a-select-option value="dtls">dtls (DTLS 1.2 packages)</a-select-option>                        <a-select-option value="wireguard">wireguard (wireguard packages)</a-select-option>                    </a-select>                </a-form-item>            </td>        </tr>        <tr>            <td>{{ i18n "password" }}</td>            <td>                <a-form-item>                    <a-input v-model="outbound.stream.kcp.seed" style="width: 250px;"></a-input>                </a-form-item>            </td>        </tr>        <tr>            <td>mtu</td>            <td>                <a-form-item>                    <a-input-number v-model.number="outbound.stream.kcp.mtu"></a-input-number>                </a-form-item>            </td>        </tr>        <tr>            <td>tti (ms)</td>            <td>                <a-form-item>                    <a-input-number v-model.number="outbound.stream.kcp.tti"></a-input-number>                </a-form-item>            </td>        </tr>        <tr>            <td>uplink capacity (MB/S)</td>            <td>                <a-form-item>                    <a-input-number v-model.number="outbound.stream.kcp.upCap"></a-input-number>                </a-form-item>             </td>        </tr>        <tr>            <td>downlink capacity (MB/S)</td>            <td>                <a-form-item>                    <a-input-number v-model.number="outbound.stream.kcp.downCap"></a-input-number>                </a-form-item>            </td>        </tr>        <tr>            <td>congestion</td>            <td>                <a-form-item>                    <a-switch v-model="outbound.stream.kcp.congestion"></a-switch>                </a-form-item>            </td>        </tr>        <tr>            <td>read buffer size (MB)</td>            <td>                <a-form-item>                    <a-input-number v-model.number="outbound.stream.kcp.readBuffer"></a-input-number>                </a-form-item>            </td>        </tr>        <tr>            <td>write buffer size (MB)</td>            <td>                <a-form-item>                    <a-input-number v-model.number="outbound.stream.kcp.writeBuffer"></a-input-number>                </a-form-item>            </td>        </tr>    </template>        <!-- ws -->    <template v-if="outbound.stream.network === 'ws'">        <tr>            <td>{{ i18n "host" }}</td>            <td><a-form-item><a-input style="width: 250px" v-model="outbound.stream.ws.host"></a-input></a-form-item></td>        </tr>        <tr>            <td>{{ i18n "path" }}</td>            <td><a-form-item><a-input style="width: 250px;" v-model.trim="outbound.stream.ws.path"></a-input></a-form-item></td>        </tr>    </template>        <!-- http -->    <template v-if="outbound.stream.network === 'http'">        <tr>            <td>{{ i18n "host" }}</td>            <td>                <a-form-item>                    <a-input v-model.trim="outbound.stream.http.host" style="width: 250px;"></a-input>                </a-form-item>            </td>        </tr>        <tr>            <td>{{ i18n "path" }}</td>            <td>                <a-form-item>                    <a-input v-model.trim="outbound.stream.http.path" style="width: 250px;"></a-input>                </a-form-item>            </td>        </tr>    </template>        <!-- quic -->    <template v-if="outbound.stream.network === 'quic'">        <tr>            <td>{{ i18n "pages.inbounds.stream.quic.encryption" }}</td>            <td>                <a-form-item>                    <a-select v-model="outbound.stream.quic.security" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">                        <a-select-option value="none">none</a-select-option>                        <a-select-option value="aes-128-gcm">aes-128-gcm</a-select-option>                        <a-select-option value="chacha20-poly1305">chacha20-poly1305</a-select-option>                    </a-select>                </a-form-item>            </td>        </tr>        <tr>            <td>{{ i18n "password" }}</td>            <td>                <a-form-item>                    <a-input v-model.trim="outbound.stream.quic.key" style="width: 250px;"></a-input>                </a-form-item>             </td>        </tr>        <tr>            <td>{{ i18n "camouflage" }}</td>            <td>                <a-form-item>                    <a-select v-model="outbound.stream.quic.type" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">                        <a-select-option value="none">none (not camouflage)</a-select-option>                        <a-select-option value="srtp">srtp (video call)</a-select-option>                        <a-select-option value="utp">utp (BT download)</a-select-option>                        <a-select-option value="wechat-video">wechat-video (WeChat video)</a-select-option>                        <a-select-option value="dtls">dtls (DTLS 1.2 packages)</a-select-option>                        <a-select-option value="wireguard">wireguard (wireguard packages)</a-select-option>                    </a-select>                </a-form-item>            </td>        </tr>    </template>        <!-- grpc -->    <template v-if="outbound.stream.network === 'grpc'">        <tr>            <td>serviceName</td>            <td>                <a-form-item>                    <a-input v-model.trim="outbound.stream.grpc.serviceName" style="width: 250px;"></a-input>                </a-form-item>            </td>        </tr>        <tr>            <td>MultiMode</td>            <td>                <a-form-item>                    <a-switch v-model="outbound.stream.grpc.multiMode"></a-switch>                </a-form-item>            </td>        </tr>    </template></template><!-- tls settings --><template v-if="outbound.canEnableTls()">        <tr>            <td>{{ i18n "security" }}</td>            <td>                <a-form-item>                    <a-radio-group v-model="outbound.stream.security" button-style="solid">                        <a-radio-button value="none">{{ i18n "none" }}</a-radio-button>                        <a-radio-button value="tls">TLS</a-radio-button>                        <a-radio-button v-if="outbound.canEnableReality()" value="reality">Reality</a-radio-button>                    </a-radio-group>                </a-form-item>            </td>        </tr>        <template v-if="outbound.stream.isTls">            <tr>                <td>SNI</td>                <td>                    <a-form-item placeholder="Server Name Indication">                        <a-input v-model.trim="outbound.stream.tls.serverName" style="width: 250px"></a-input>                    </a-form-item>                                </td>            </tr>            <tr>                <td>uTLS</td>                <td>                    <a-form-item>                        <a-select v-model="outbound.stream.tls.fingerprint"                                    style="width: 250px" :dropdown-class-name="themeSwitcher.currentTheme">                            <a-select-option value=''>None</a-select-option>                            <a-select-option v-for="key in UTLS_FINGERPRINT" :value="key">[[ key ]]</a-select-option>                        </a-select>                    </a-form-item>                </td>            </tr>            <tr>                <td>ALPN</td>                <td>                    <a-form-item>                        <a-select                            mode="multiple"                            style="width: 250px"                            :dropdown-class-name="themeSwitcher.currentTheme"                            v-model="outbound.stream.tls.alpn">                            <a-select-option v-for="alpn in ALPN_OPTION" :value="alpn">[[ alpn ]]</a-select-option>                        </a-select>                    </a-form-item>                </td>            </tr>            <tr>                <td>Allow insecure</td>                <td>                    <a-form-item>                        <a-switch v-model="outbound.stream.tls.allowInsecure"></a-switch>                    </a-form-item>                </td>            </tr>        </template>                <!-- reality settings -->        <template v-if="outbound.stream.isReality">                <tr>                    <td>{{ i18n "domainName" }}</td>                    <td>                        <a-form-item>                            <a-input v-model.trim="outbound.stream.reality.serverName" style="width: 250px"></a-input>                        </a-form-item>                    </td>                </tr>                <tr>                    <td>uTLS</td>                    <td>                        <a-form-item>                            <a-select v-model="outbound.stream.reality.fingerprint"                                      style="width: 250px" :dropdown-class-name="themeSwitcher.currentTheme">                                <a-select-option v-for="key in UTLS_FINGERPRINT" :value="key">[[ key ]]</a-select-option>                            </a-select>                        </a-form-item>                    </td>                </tr>                <tr>                    <td>Short Id</td>                    <td>                        <a-form-item>                            <a-input v-model.trim="outbound.stream.reality.shortId" style="width:250px"></a-input>                        </a-form-item>                    </td>                </tr>                <tr>                    <td>SpiderX</td>                    <td>                        <a-form-item>                            <a-input v-model.trim="outbound.stream.reality.spiderX" style="width:250px"></a-input>                        </a-form-item>                    </td>                </tr>                <tr>                    <td>Public Key</td>                    <td>                        <a-form-item>                            <a-input v-model.trim="outbound.stream.reality.publicKey" style="width: 250px"></a-input>                        </a-form-item>                    </td>                </tr>        </template></template>    </table></a-form></a-tab-pane><a-tab-pane key="2" tab="JSON" force-render="true">    <a-form-item style="margin: 10px 0">        Link: <a-input v-model.trim="outModal.link" style="width: 300px; margin-right: 5px;" placeholder="vmess:// vless:// trojan:// ss://"></a-input>        <a-button @click="convertLink" type="primary"><a-icon type="form"></a-icon></a-button>    </a-form-item>        <textarea style="position:absolute; left: -800px;" id="outboundJson"></textarea></a-tab-pane></a-tabs>{{end}}
 |