outbound.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  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. <a-form-item label='{{ i18n "protocol" }}'>
  7. <a-select v-model="outbound.protocol" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
  8. <a-select-option v-for="x,y in Protocols" :value="x">[[ y ]]</a-select-option>
  9. </a-select>
  10. </a-form-item>
  11. <a-form-item label='{{ i18n "pages.xray.outbound.tag" }}'>
  12. <a-input v-model.trim="outbound.tag" style="width: 250px" @change="outModal.check()" :style="outModal.duplicateTag? 'border-color: red;' : ''"></a-input>
  13. </a-form-item>
  14. <!-- freedom settings-->
  15. <template v-if="outbound.protocol === Protocols.Freedom">
  16. <a-form-item label="Strategy">
  17. <a-select
  18. v-model="outbound.settings.domainStrategy"
  19. style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
  20. <a-select-option v-for="s in outboundDomainStrategies" :value="s">[[ s ]]</a-select-option>
  21. </a-select>
  22. </a-form-item>
  23. <a-form-item label="Fragment">
  24. <a-switch
  25. :checked="Object.keys(outbound.settings.fragment).length >0"
  26. @change="checked => outbound.settings.fragment = checked ? new Outbound.FreedomSettings.Fragment() : {}">
  27. </a-switch>
  28. </a-form-item>
  29. <template v-if="Object.keys(outbound.settings.fragment).length >0">
  30. <a-form-item label="Packets">
  31. <a-select
  32. v-model="outbound.settings.fragment.packets"
  33. style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
  34. <a-select-option v-for="s in ['1-3','tlshello']" :value="s">[[ s ]]</a-select-option>
  35. </a-select>
  36. </a-form-item>
  37. <a-form-item label="Length">
  38. <a-input v-model.trim="outbound.settings.fragment.length" style="width: 250px"></a-input>
  39. </a-form-item>
  40. <a-form-item label="Interval">
  41. <a-input v-model.trim="outbound.settings.fragment.interval" style="width: 250px"></a-input>
  42. </a-form-item>
  43. </template>
  44. </template>
  45. <!-- blackhole settings -->
  46. <template v-if="outbound.protocol === Protocols.Blackhole">
  47. <a-form-item label="Response Type">
  48. <a-select
  49. v-model="outbound.settings.type"
  50. style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
  51. <a-select-option v-for="s in ['', 'none','http']" :value="s">[[ s ]]</a-select-option>
  52. </a-select>
  53. </a-form-item>
  54. </template>
  55. <!-- dns settings -->
  56. <template v-if="outbound.protocol === Protocols.DNS">
  57. <a-form-item label='{{ i18n "pages.inbounds.network" }}'>
  58. <a-select
  59. v-model="outbound.settings.network"
  60. style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
  61. <a-select-option v-for="s in ['udp','tcp']" :value="s">[[ s ]]</a-select-option>
  62. </a-select>
  63. </a-form-item>
  64. </template>
  65. <!-- Address + Port -->
  66. <template v-if="outbound.hasAddressPort()">
  67. <a-form-item label='{{ i18n "pages.inbounds.address" }}'>
  68. <a-input v-model.trim="outbound.settings.address" style="width: 250px"></a-input>
  69. </a-form-item>
  70. <a-form-item label='{{ i18n "pages.inbounds.port" }}'>
  71. <a-input-number v-model.number="outbound.settings.port"></a-input-number>
  72. </a-form-item>
  73. </template>
  74. <!-- Vnext (vless/vmess) settings -->
  75. <template v-if="[Protocols.VMess, Protocols.VLESS].includes(outbound.protocol)">
  76. <a-form-item label="ID">
  77. <a-input v-model.trim="outbound.settings.id" style="width: 250px"></a-input>
  78. </a-form-item>
  79. <!-- vless settings -->
  80. <template v-if="outbound.canEnableTlsFlow()">
  81. <a-form-item label="Flow">
  82. <a-select v-model="outbound.settings.flow" style="width: 250px" :dropdown-class-name="themeSwitcher.currentTheme">
  83. <a-select-option value="" selected>{{ i18n "none" }}</a-select-option>
  84. <a-select-option v-for="key in TLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option>
  85. </a-select>
  86. </a-form-item>
  87. </template>
  88. </template>
  89. <!-- Servers (trojan/shadowsocks/socks/http) settings -->
  90. <template v-if="outbound.hasServers()">
  91. <template v-if="outbound.hasUsername()">
  92. <a-form-item label='{{ i18n "username" }}'>
  93. <a-input v-model.trim="outbound.settings.user" style="width: 250px"></a-input>
  94. </a-form-item>
  95. <a-form-item label='{{ i18n "password" }}'>
  96. <a-input v-model.trim="outbound.settings.password" style="width: 250px"></a-input>
  97. </a-form-item>
  98. </template>
  99. <!-- shadowsocks -->
  100. <template v-if="outbound.protocol === Protocols.Shadowsocks">
  101. <a-form-item label='{{ i18n "encryption" }}'>
  102. <a-select v-model="outbound.settings.method" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
  103. <a-select-option v-for="method in SSMethods" :value="method">[[ method ]]</a-select-option>
  104. </a-select>
  105. </a-form-item>
  106. <a-form-item label="UDP over TCP">
  107. <a-switch v-model="outbound.settings.uot"></a-switch>
  108. </a-form-item>
  109. </template>
  110. </template>
  111. <!-- stream settings -->
  112. <template v-if="outbound.canEnableStream()">
  113. <a-form-item label='{{ i18n "transmission" }}'>
  114. <a-select v-model="outbound.stream.network" @change="streamNetworkChange"
  115. style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
  116. <a-select-option value="tcp">TCP</a-select-option>
  117. <a-select-option value="kcp">KCP</a-select-option>
  118. <a-select-option value="ws">WebSocket</a-select-option>
  119. <a-select-option value="http">HTTP2</a-select-option>
  120. <a-select-option value="quic">QUIC</a-select-option>
  121. <a-select-option value="grpc">gRPC</a-select-option>
  122. </a-select>
  123. </a-form-item>
  124. <template v-if="outbound.stream.network === 'tcp'">
  125. <a-form-item label='http {{ i18n "camouflage" }}'>
  126. <a-switch
  127. :checked="outbound.stream.tcp.type === 'http'"
  128. @change="checked => outbound.stream.tcp.type = checked ? 'http' : 'none'">
  129. </a-switch>
  130. </a-form-item>
  131. <template v-if="outbound.stream.tcp.type == 'http'">
  132. <a-form-item label='{{ i18n "host" }}'>
  133. <a-input style="width: 250px;" v-model.trim="outbound.stream.tcp.host"></a-input>
  134. </a-form-item>
  135. <a-form-item label='{{ i18n "path" }}'>
  136. <a-input style="width: 250px;" v-model.trim="outbound.stream.tcp.path"></a-input>
  137. </a-form-item>
  138. </template>
  139. </template>
  140. <!-- kcp -->
  141. <template v-if="outbound.stream.network === 'kcp'">
  142. <a-form-item label='{{ i18n "camouflage" }}'>
  143. <a-select v-model="outbound.stream.kcp.type" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
  144. <a-select-option value="none">none (not camouflage)</a-select-option>
  145. <a-select-option value="srtp">srtp (video call)</a-select-option>
  146. <a-select-option value="utp">utp (BT download)</a-select-option>
  147. <a-select-option value="wechat-video">wechat-video (WeChat video)</a-select-option>
  148. <a-select-option value="dtls">dtls (DTLS 1.2 packages)</a-select-option>
  149. <a-select-option value="wireguard">wireguard (wireguard packages)</a-select-option>
  150. </a-select>
  151. </a-form-item>
  152. <a-form-item label='{{ i18n "password" }}'>
  153. <a-input v-model="outbound.stream.kcp.seed" style="width: 250px;"></a-input>
  154. </a-form-item>
  155. <a-form-item label="mtu">
  156. <a-input-number v-model.number="outbound.stream.kcp.mtu"></a-input-number>
  157. </a-form-item>
  158. <a-form-item label="tti (ms)">
  159. <a-input-number v-model.number="outbound.stream.kcp.tti"></a-input-number>
  160. </a-form-item>
  161. <a-form-item label="uplink capacity (MB/S)">
  162. <a-input-number v-model.number="outbound.stream.kcp.upCap"></a-input-number>
  163. </a-form-item>
  164. <a-form-item label="downlink capacity (MB/S)">
  165. <a-input-number v-model.number="outbound.stream.kcp.downCap"></a-input-number>
  166. </a-form-item>
  167. <a-form-item label="congestion">
  168. <a-switch v-model="outbound.stream.kcp.congestion"></a-switch>
  169. </a-form-item>
  170. <a-form-item label="read buffer size (MB)">
  171. <a-input-number v-model.number="outbound.stream.kcp.readBuffer"></a-input-number>
  172. </a-form-item>
  173. <a-form-item label="write buffer size (MB)">
  174. <a-input-number v-model.number="outbound.stream.kcp.writeBuffer"></a-input-number>
  175. </a-form-item>
  176. </template>
  177. <!-- ws -->
  178. <template v-if="outbound.stream.network === 'ws'">
  179. <a-form-item label='{{ i18n "host" }}'>
  180. <a-input style="width: 250px" v-model="outbound.stream.ws.host"></a-input>
  181. </a-form-item>
  182. <a-form-item label='{{ i18n "path" }}'>
  183. <a-input style="width: 250px;" v-model.trim="outbound.stream.ws.path"></a-input>
  184. </a-form-item>
  185. </template>
  186. <!-- http -->
  187. <template v-if="outbound.stream.network === 'http'">
  188. <a-form-item label='{{ i18n "host" }}'>
  189. <a-input v-model.trim="outbound.stream.http.host" style="width: 250px;"></a-input>
  190. </a-form-item>
  191. <a-form-item label='{{ i18n "path" }}'>
  192. <a-input v-model.trim="outbound.stream.http.path" style="width: 250px;"></a-input>
  193. </a-form-item>
  194. </template>
  195. <!-- quic -->
  196. <template v-if="outbound.stream.network === 'quic'">
  197. <a-form-item label='{{ i18n "pages.inbounds.stream.quic.encryption" }}'>
  198. <a-select v-model="outbound.stream.quic.security" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
  199. <a-select-option value="none">none</a-select-option>
  200. <a-select-option value="aes-128-gcm">aes-128-gcm</a-select-option>
  201. <a-select-option value="chacha20-poly1305">chacha20-poly1305</a-select-option>
  202. </a-select>
  203. </a-form-item>
  204. <a-form-item label='{{ i18n "password" }}'>
  205. <a-input v-model.trim="outbound.stream.quic.key" style="width: 250px;"></a-input>
  206. </a-form-item>
  207. <a-form-item label='{{ i18n "camouflage" }}'>
  208. <a-select v-model="outbound.stream.quic.type" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
  209. <a-select-option value="none">none (not camouflage)</a-select-option>
  210. <a-select-option value="srtp">srtp (video call)</a-select-option>
  211. <a-select-option value="utp">utp (BT download)</a-select-option>
  212. <a-select-option value="wechat-video">wechat-video (WeChat video)</a-select-option>
  213. <a-select-option value="dtls">dtls (DTLS 1.2 packages)</a-select-option>
  214. <a-select-option value="wireguard">wireguard (wireguard packages)</a-select-option>
  215. </a-select>
  216. </a-form-item>
  217. </template>
  218. <!-- grpc -->
  219. <template v-if="outbound.stream.network === 'grpc'">
  220. <a-form-item label="serviceName">
  221. <a-input v-model.trim="outbound.stream.grpc.serviceName" style="width: 250px;"></a-input>
  222. </a-form-item>
  223. <a-form-item label="MultiMode">
  224. <a-switch v-model="outbound.stream.grpc.multiMode"></a-switch>
  225. </a-form-item>
  226. </template>
  227. </template>
  228. <!-- tls settings -->
  229. <template v-if="outbound.canEnableTls()">
  230. <a-form-item label='{{ i18n "security" }}'>
  231. <a-radio-group v-model="outbound.stream.security" button-style="solid">
  232. <a-radio-button value="none">{{ i18n "none" }}</a-radio-button>
  233. <a-radio-button value="tls">TLS</a-radio-button>
  234. <a-radio-button v-if="outbound.canEnableReality()" value="reality">Reality</a-radio-button>
  235. </a-radio-group>
  236. </a-form-item><br />
  237. <template v-if="outbound.stream.isTls">
  238. <a-form-item label="SNI" placeholder="Server Name Indication">
  239. <a-input v-model.trim="outbound.stream.tls.serverName" style="width: 250px"></a-input>
  240. </a-form-item>
  241. <a-form-item label="uTLS">
  242. <a-select v-model="outbound.stream.tls.fingerprint"
  243. style="width: 250px" :dropdown-class-name="themeSwitcher.currentTheme">
  244. <a-select-option value=''>None</a-select-option>
  245. <a-select-option v-for="key in UTLS_FINGERPRINT" :value="key">[[ key ]]</a-select-option>
  246. </a-select>
  247. </a-form-item>
  248. <a-form-item label="ALPN">
  249. <a-select
  250. mode="multiple"
  251. style="width: 250px"
  252. :dropdown-class-name="themeSwitcher.currentTheme"
  253. v-model="outbound.stream.tls.alpn">
  254. <a-select-option v-for="alpn in ALPN_OPTION" :value="alpn">[[ alpn ]]</a-select-option>
  255. </a-select>
  256. </a-form-item>
  257. <a-form-item label="Allow insecure">
  258. <a-switch v-model="outbound.stream.tls.allowInsecure"></a-switch>
  259. </a-form-item>
  260. </template>
  261. <!-- reality settings -->
  262. <template v-if="outbound.stream.isReality">
  263. <a-form-item label='{{ i18n "domainName" }}'>
  264. <a-input v-model.trim="outbound.stream.reality.serverName" style="width: 250px"></a-input>
  265. </a-form-item>
  266. <a-form-item label="uTLS">
  267. <a-select v-model="outbound.stream.reality.fingerprint"
  268. style="width: 250px" :dropdown-class-name="themeSwitcher.currentTheme">
  269. <a-select-option v-for="key in UTLS_FINGERPRINT" :value="key">[[ key ]]</a-select-option>
  270. </a-select>
  271. </a-form-item>
  272. <a-form-item label="Short Id">
  273. <a-input v-model.trim="outbound.stream.reality.shortId" style="width:250px"></a-input>
  274. </a-form-item>
  275. <a-form-item label="SpiderX">
  276. <a-input v-model.trim="outbound.stream.reality.spiderX" style="width:250px"></a-input>
  277. </a-form-item>
  278. <a-form-item label="Public Key">
  279. <a-input v-model.trim="outbound.stream.reality.publicKey" style="width: 250px"></a-input>
  280. </a-form-item>
  281. </template>
  282. </template>
  283. </a-form>
  284. </a-tab-pane>
  285. <a-tab-pane key="2" tab="JSON" force-render="true">
  286. <a-form-item style="margin: 10px 0">
  287. Link: <a-input v-model.trim="outModal.link" style="width: 300px; margin-right: 5px;" placeholder="vmess:// vless:// trojan:// ss://"></a-input>
  288. <a-button @click="convertLink" type="primary"><a-icon type="form"></a-icon></a-button>
  289. </a-form-item>
  290. <textarea style="position:absolute; left: -800px;" id="outboundJson"></textarea>
  291. </a-tab-pane>
  292. </a-tabs>
  293. {{end}}