outbound.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. {{define "form/outbound"}}
  2. <!-- base -->
  3. <a-tabs :active-key="outModal.activeKey" style="padding: 0; background-color: transparent;" @change="(activeKey) => {outModal.toggleJson(activeKey == '2'); }">
  4. <a-tab-pane key="1" tab="Form">
  5. <a-form layout="inline">
  6. <table width="100%" class="ant-table-tbody">
  7. <tr>
  8. <td>{{ i18n "protocol" }}</td>
  9. <td>
  10. <a-form-item>
  11. <a-select v-model="outbound.protocol" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
  12. <a-select-option v-for="x,y in Protocols" :value="x">[[ y ]]</a-select-option>
  13. </a-select>
  14. </a-form-item>
  15. </td>
  16. </tr>
  17. <tr>
  18. <td>{{ i18n "pages.xray.outbound.tag" }}</td>
  19. <td>
  20. <a-form-item has-feedback :validate-status="outModal.duplicateTag? 'warning' : 'success'">
  21. <a-input v-model.trim="outbound.tag" style="width: 250px" @change="outModal.check()" placeholder='{{ i18n "pages.xray.outbound.tagDesc" }}'></a-input>
  22. </a-form-item>
  23. </td>
  24. </tr>
  25. <!-- freedom settings-->
  26. <template v-if="outbound.protocol === Protocols.Freedom">
  27. <tr>
  28. <td>Strategy</td>
  29. <td>
  30. <a-form-item>
  31. <a-select
  32. v-model="outbound.settings.domainStrategy"
  33. style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
  34. <a-select-option v-for="s in outboundDomainStrategies" :value="s">[[ s ]]</a-select-option>
  35. </a-select>
  36. </a-form-item>
  37. </td>
  38. </tr>
  39. <tr>
  40. <td>Fragment</td>
  41. <td>
  42. <a-form-item>
  43. <a-switch
  44. :checked="Object.keys(outbound.settings.fragment).length >0"
  45. @change="checked => outbound.settings.fragment = checked ? new Outbound.FreedomSettings.Fragment() : {}">
  46. </a-switch>
  47. </a-form-item>
  48. </td>
  49. </tr>
  50. <template v-if="Object.keys(outbound.settings.fragment).length >0">
  51. <tr>
  52. <td>Packets</td>
  53. <td>
  54. <a-form-item>
  55. <a-select
  56. v-model="outbound.settings.fragment.packets"
  57. style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
  58. <a-select-option v-for="s in ['1-3','tlshello']" :value="s">[[ s ]]</a-select-option>
  59. </a-select>
  60. </a-form-item>
  61. </td>
  62. </tr>
  63. <tr>
  64. <td>Length</td>
  65. <td>
  66. <a-form-item>
  67. <a-input v-model.trim="outbound.settings.fragment.length" style="width: 250px"></a-input>
  68. </a-form-item>
  69. </td>
  70. </tr>
  71. <tr>
  72. <td>Interval</td>
  73. <td>
  74. <a-form-item>
  75. <a-input v-model.trim="outbound.settings.fragment.interval" style="width: 250px"></a-input>
  76. </a-form-item>
  77. </td>
  78. </tr>
  79. </template>
  80. </template>
  81. <!-- blackhole settings -->
  82. <template v-if="outbound.protocol === Protocols.Blackhole">
  83. <tr>
  84. <td>Response Type</td>
  85. <td>
  86. <a-form-item>
  87. <a-select
  88. v-model="outbound.settings.type"
  89. style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
  90. <a-select-option v-for="s in ['', 'none','http']" :value="s">[[ s ]]</a-select-option>
  91. </a-select>
  92. </a-form-item>
  93. </td>
  94. </tr>
  95. </template>
  96. <!-- dns settings -->
  97. <template v-if="outbound.protocol === Protocols.DNS">
  98. <tr>
  99. <td>{{ i18n "pages.inbounds.network" }}</td>
  100. <td>
  101. <a-form-item>
  102. <a-select
  103. v-model="outbound.settings.network"
  104. style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
  105. <a-select-option v-for="s in ['udp','tcp']" :value="s">[[ s ]]</a-select-option>
  106. </a-select>
  107. </a-form-item>
  108. </td>
  109. </tr>
  110. </template>
  111. <!-- Address + Port -->
  112. <template v-if="outbound.hasAddressPort()">
  113. <tr>
  114. <td>{{ i18n "pages.inbounds.address" }}</td>
  115. <td>
  116. <a-form-item>
  117. <a-input v-model.trim="outbound.settings.address" style="width: 250px"></a-input>
  118. </a-form-item>
  119. </td>
  120. </tr>
  121. <tr>
  122. <td>{{ i18n "pages.inbounds.port" }}</td>
  123. <td>
  124. <a-form-item>
  125. <a-input-number v-model.number="outbound.settings.port" :min="1" :max="65532"></a-input-number>
  126. </a-form-item>
  127. </td>
  128. </tr>
  129. </template>
  130. <!-- Vnext (vless/vmess) settings -->
  131. <template v-if="[Protocols.VMess, Protocols.VLESS].includes(outbound.protocol)">
  132. <tr>
  133. <td>ID</td>
  134. <td>
  135. <a-form-item>
  136. <a-input v-model.trim="outbound.settings.id" style="width: 250px"></a-input>
  137. </a-form-item>
  138. </td>
  139. </tr>
  140. <!-- vless settings -->
  141. <template v-if="outbound.canEnableTlsFlow()">
  142. <tr>
  143. <td>Flow</td>
  144. <td>
  145. <a-form-item>
  146. <a-select v-model="outbound.settings.flow" style="width: 250px" :dropdown-class-name="themeSwitcher.currentTheme">
  147. <a-select-option value="" selected>{{ i18n "none" }}</a-select-option>
  148. <a-select-option v-for="key in TLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option>
  149. </a-select>
  150. </a-form-item>
  151. </td>
  152. </tr>
  153. </template>
  154. </template>
  155. <!-- Servers (trojan/shadowsocks/socks/http) settings -->
  156. <template v-if="outbound.hasServers()">
  157. <tr v-if="outbound.hasUsername()">
  158. <td>{{ i18n "username" }}</td>
  159. <td>
  160. <a-form-item>
  161. <a-input v-model.trim="outbound.settings.user" style="width: 250px"></a-input>
  162. </a-form-item>
  163. </td>
  164. </tr>
  165. <tr>
  166. <td>{{ i18n "password" }}</td>
  167. <td>
  168. <a-form-item>
  169. <a-input v-model.trim="outbound.settings.password" style="width: 250px"></a-input>
  170. </a-form-item>
  171. </td>
  172. </tr>
  173. <!-- shadowsocks -->
  174. <template v-if="outbound.protocol === Protocols.Shadowsocks">
  175. <tr>
  176. <td>{{ i18n "encryption" }}</td>
  177. <td>
  178. <a-form-item>
  179. <a-select v-model="outbound.settings.method" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
  180. <a-select-option v-for="method in SSMethods" :value="method">[[ method ]]</a-select-option>
  181. </a-select>
  182. </a-form-item>
  183. </td>
  184. </tr>
  185. <tr>
  186. <td>UDP over TCP</td>
  187. <td>
  188. <a-form-item>
  189. <a-switch v-model="outbound.settings.uot"></a-switch>
  190. </a-form-item>
  191. </td>
  192. </tr>
  193. </template>
  194. </template>
  195. <!-- stream settings -->
  196. <template v-if="outbound.canEnableStream()">
  197. <tr>
  198. <td>{{ i18n "transmission" }}</td>
  199. <td>
  200. <a-form-item>
  201. <a-select v-model="outbound.stream.network" @change="streamNetworkChange"
  202. style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
  203. <a-select-option value="tcp">TCP</a-select-option>
  204. <a-select-option value="kcp">KCP</a-select-option>
  205. <a-select-option value="ws">WebSocket</a-select-option>
  206. <a-select-option value="http">HTTP2</a-select-option>
  207. <a-select-option value="quic">QUIC</a-select-option>
  208. <a-select-option value="grpc">gRPC</a-select-option>
  209. </a-select>
  210. </a-form-item>
  211. </td>
  212. </tr>
  213. <template v-if="outbound.stream.network === 'tcp'">
  214. <tr>
  215. <td>http {{ i18n "camouflage" }}</td>
  216. <td>
  217. <a-form-item>
  218. <a-switch
  219. :checked="outbound.stream.tcp.type === 'http'"
  220. @change="checked => outbound.stream.tcp.type = checked ? 'http' : 'none'">
  221. </a-switch>
  222. </a-form-item>
  223. </td>
  224. </tr>
  225. <template v-if="outbound.stream.tcp.type == 'http'">
  226. <tr>
  227. <td>{{ i18n "host" }}</td>
  228. <td>
  229. <a-form-item>
  230. <a-input style="width: 250px;" v-model.trim="outbound.stream.tcp.host"></a-input>
  231. </a-form-item>
  232. </td>
  233. </tr>
  234. <tr>
  235. <td>{{ i18n "path" }}</td>
  236. <td>
  237. <a-form-item>
  238. <a-input style="width: 250px;" v-model.trim="outbound.stream.tcp.path"></a-input>
  239. </a-form-item>
  240. </td>
  241. </tr>
  242. </template>
  243. </template>
  244. <!-- kcp -->
  245. <template v-if="outbound.stream.network === 'kcp'">
  246. <tr>
  247. <td>{{ i18n "camouflage" }}</td>
  248. <td>
  249. <a-form-item>
  250. <a-select v-model="outbound.stream.kcp.type" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
  251. <a-select-option value="none">none (not camouflage)</a-select-option>
  252. <a-select-option value="srtp">srtp (video call)</a-select-option>
  253. <a-select-option value="utp">utp (BT download)</a-select-option>
  254. <a-select-option value="wechat-video">wechat-video (WeChat video)</a-select-option>
  255. <a-select-option value="dtls">dtls (DTLS 1.2 packages)</a-select-option>
  256. <a-select-option value="wireguard">wireguard (wireguard packages)</a-select-option>
  257. </a-select>
  258. </a-form-item>
  259. </td>
  260. </tr>
  261. <tr>
  262. <td>{{ i18n "password" }}</td>
  263. <td>
  264. <a-form-item>
  265. <a-input v-model="outbound.stream.kcp.seed" style="width: 250px;"></a-input>
  266. </a-form-item>
  267. </td>
  268. </tr>
  269. <tr>
  270. <td>mtu</td>
  271. <td>
  272. <a-form-item>
  273. <a-input-number v-model.number="outbound.stream.kcp.mtu"></a-input-number>
  274. </a-form-item>
  275. </td>
  276. </tr>
  277. <tr>
  278. <td>tti (ms)</td>
  279. <td>
  280. <a-form-item>
  281. <a-input-number v-model.number="outbound.stream.kcp.tti"></a-input-number>
  282. </a-form-item>
  283. </td>
  284. </tr>
  285. <tr>
  286. <td>uplink capacity (MB/S)</td>
  287. <td>
  288. <a-form-item>
  289. <a-input-number v-model.number="outbound.stream.kcp.upCap"></a-input-number>
  290. </a-form-item>
  291. </td>
  292. </tr>
  293. <tr>
  294. <td>downlink capacity (MB/S)</td>
  295. <td>
  296. <a-form-item>
  297. <a-input-number v-model.number="outbound.stream.kcp.downCap"></a-input-number>
  298. </a-form-item>
  299. </td>
  300. </tr>
  301. <tr>
  302. <td>congestion</td>
  303. <td>
  304. <a-form-item>
  305. <a-switch v-model="outbound.stream.kcp.congestion"></a-switch>
  306. </a-form-item>
  307. </td>
  308. </tr>
  309. <tr>
  310. <td>read buffer size (MB)</td>
  311. <td>
  312. <a-form-item>
  313. <a-input-number v-model.number="outbound.stream.kcp.readBuffer"></a-input-number>
  314. </a-form-item>
  315. </td>
  316. </tr>
  317. <tr>
  318. <td>write buffer size (MB)</td>
  319. <td>
  320. <a-form-item>
  321. <a-input-number v-model.number="outbound.stream.kcp.writeBuffer"></a-input-number>
  322. </a-form-item>
  323. </td>
  324. </tr>
  325. </template>
  326. <!-- ws -->
  327. <template v-if="outbound.stream.network === 'ws'">
  328. <tr>
  329. <td>{{ i18n "host" }}</td>
  330. <td><a-form-item><a-input style="width: 250px" v-model="outbound.stream.ws.host"></a-input></a-form-item></td>
  331. </tr>
  332. <tr>
  333. <td>{{ i18n "path" }}</td>
  334. <td><a-form-item><a-input style="width: 250px;" v-model.trim="outbound.stream.ws.path"></a-input></a-form-item></td>
  335. </tr>
  336. </template>
  337. <!-- http -->
  338. <template v-if="outbound.stream.network === 'http'">
  339. <tr>
  340. <td>{{ i18n "host" }}</td>
  341. <td>
  342. <a-form-item>
  343. <a-input v-model.trim="outbound.stream.http.host" style="width: 250px;"></a-input>
  344. </a-form-item>
  345. </td>
  346. </tr>
  347. <tr>
  348. <td>{{ i18n "path" }}</td>
  349. <td>
  350. <a-form-item>
  351. <a-input v-model.trim="outbound.stream.http.path" style="width: 250px;"></a-input>
  352. </a-form-item>
  353. </td>
  354. </tr>
  355. </template>
  356. <!-- quic -->
  357. <template v-if="outbound.stream.network === 'quic'">
  358. <tr>
  359. <td>{{ i18n "pages.inbounds.stream.quic.encryption" }}</td>
  360. <td>
  361. <a-form-item>
  362. <a-select v-model="outbound.stream.quic.security" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
  363. <a-select-option value="none">none</a-select-option>
  364. <a-select-option value="aes-128-gcm">aes-128-gcm</a-select-option>
  365. <a-select-option value="chacha20-poly1305">chacha20-poly1305</a-select-option>
  366. </a-select>
  367. </a-form-item>
  368. </td>
  369. </tr>
  370. <tr>
  371. <td>{{ i18n "password" }}</td>
  372. <td>
  373. <a-form-item>
  374. <a-input v-model.trim="outbound.stream.quic.key" style="width: 250px;"></a-input>
  375. </a-form-item>
  376. </td>
  377. </tr>
  378. <tr>
  379. <td>{{ i18n "camouflage" }}</td>
  380. <td>
  381. <a-form-item>
  382. <a-select v-model="outbound.stream.quic.type" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
  383. <a-select-option value="none">none (not camouflage)</a-select-option>
  384. <a-select-option value="srtp">srtp (video call)</a-select-option>
  385. <a-select-option value="utp">utp (BT download)</a-select-option>
  386. <a-select-option value="wechat-video">wechat-video (WeChat video)</a-select-option>
  387. <a-select-option value="dtls">dtls (DTLS 1.2 packages)</a-select-option>
  388. <a-select-option value="wireguard">wireguard (wireguard packages)</a-select-option>
  389. </a-select>
  390. </a-form-item>
  391. </td>
  392. </tr>
  393. </template>
  394. <!-- grpc -->
  395. <template v-if="outbound.stream.network === 'grpc'">
  396. <tr>
  397. <td>serviceName</td>
  398. <td>
  399. <a-form-item>
  400. <a-input v-model.trim="outbound.stream.grpc.serviceName" style="width: 250px;"></a-input>
  401. </a-form-item>
  402. </td>
  403. </tr>
  404. <tr>
  405. <td>MultiMode</td>
  406. <td>
  407. <a-form-item>
  408. <a-switch v-model="outbound.stream.grpc.multiMode"></a-switch>
  409. </a-form-item>
  410. </td>
  411. </tr>
  412. </template>
  413. </template>
  414. <!-- tls settings -->
  415. <template v-if="outbound.canEnableTls()">
  416. <tr>
  417. <td>{{ i18n "security" }}</td>
  418. <td>
  419. <a-form-item>
  420. <a-radio-group v-model="outbound.stream.security" button-style="solid">
  421. <a-radio-button value="none">{{ i18n "none" }}</a-radio-button>
  422. <a-radio-button value="tls">TLS</a-radio-button>
  423. <a-radio-button v-if="outbound.canEnableReality()" value="reality">Reality</a-radio-button>
  424. </a-radio-group>
  425. </a-form-item>
  426. </td>
  427. </tr>
  428. <template v-if="outbound.stream.isTls">
  429. <tr>
  430. <td>SNI</td>
  431. <td>
  432. <a-form-item placeholder="Server Name Indication">
  433. <a-input v-model.trim="outbound.stream.tls.serverName" style="width: 250px"></a-input>
  434. </a-form-item>
  435. </td>
  436. </tr>
  437. <tr>
  438. <td>uTLS</td>
  439. <td>
  440. <a-form-item>
  441. <a-select v-model="outbound.stream.tls.fingerprint"
  442. style="width: 250px" :dropdown-class-name="themeSwitcher.currentTheme">
  443. <a-select-option value=''>None</a-select-option>
  444. <a-select-option v-for="key in UTLS_FINGERPRINT" :value="key">[[ key ]]</a-select-option>
  445. </a-select>
  446. </a-form-item>
  447. </td>
  448. </tr>
  449. <tr>
  450. <td>ALPN</td>
  451. <td>
  452. <a-form-item>
  453. <a-select
  454. mode="multiple"
  455. style="width: 250px"
  456. :dropdown-class-name="themeSwitcher.currentTheme"
  457. v-model="outbound.stream.tls.alpn">
  458. <a-select-option v-for="alpn in ALPN_OPTION" :value="alpn">[[ alpn ]]</a-select-option>
  459. </a-select>
  460. </a-form-item>
  461. </td>
  462. </tr>
  463. <tr>
  464. <td>Allow insecure</td>
  465. <td>
  466. <a-form-item>
  467. <a-switch v-model="outbound.stream.tls.allowInsecure"></a-switch>
  468. </a-form-item>
  469. </td>
  470. </tr>
  471. </template>
  472. <!-- reality settings -->
  473. <template v-if="outbound.stream.isReality">
  474. <tr>
  475. <td>{{ i18n "domainName" }}</td>
  476. <td>
  477. <a-form-item>
  478. <a-input v-model.trim="outbound.stream.reality.serverName" style="width: 250px"></a-input>
  479. </a-form-item>
  480. </td>
  481. </tr>
  482. <tr>
  483. <td>uTLS</td>
  484. <td>
  485. <a-form-item>
  486. <a-select v-model="outbound.stream.reality.fingerprint"
  487. style="width: 250px" :dropdown-class-name="themeSwitcher.currentTheme">
  488. <a-select-option v-for="key in UTLS_FINGERPRINT" :value="key">[[ key ]]</a-select-option>
  489. </a-select>
  490. </a-form-item>
  491. </td>
  492. </tr>
  493. <tr>
  494. <td>Short Id</td>
  495. <td>
  496. <a-form-item>
  497. <a-input v-model.trim="outbound.stream.reality.shortId" style="width:250px"></a-input>
  498. </a-form-item>
  499. </td>
  500. </tr>
  501. <tr>
  502. <td>SpiderX</td>
  503. <td>
  504. <a-form-item>
  505. <a-input v-model.trim="outbound.stream.reality.spiderX" style="width:250px"></a-input>
  506. </a-form-item>
  507. </td>
  508. </tr>
  509. <tr>
  510. <td>Public Key</td>
  511. <td>
  512. <a-form-item>
  513. <a-input v-model.trim="outbound.stream.reality.publicKey" style="width: 250px"></a-input>
  514. </a-form-item>
  515. </td>
  516. </tr>
  517. </template>
  518. </template>
  519. </table>
  520. </a-form>
  521. </a-tab-pane>
  522. <a-tab-pane key="2" tab="JSON" force-render="true">
  523. <a-form-item style="margin: 10px 0">
  524. Link: <a-input v-model.trim="outModal.link" style="width: 300px; margin-right: 5px;" placeholder="vmess:// vless:// trojan:// ss://"></a-input>
  525. <a-button @click="convertLink" type="primary"><a-icon type="form"></a-icon></a-button>
  526. </a-form-item>
  527. <textarea style="position:absolute; left: -800px;" id="outboundJson"></textarea>
  528. </a-tab-pane>
  529. </a-tabs>
  530. {{end}}