Gozargah / Marzban

Unified GUI Censorship Resistant Solution Powered by Xray
https://t.me/gozargah_marzban
GNU Affero General Public License v3.0
3.18k stars 452 forks source link

KCP protocol Client config problem #388

Closed rickyivan closed 1 month ago

rickyivan commented 1 year ago

Bug description In KCP protocol, when we implement the protocol from any source (e.g. from Xray-examples in XTLS Github, or copying config from x-ui panels), the config exported from Marzban panel, does not contain kcp Seed (=password or path) and Header Type (e.g. none, dtls,wireguard,...) But after editing config in client app and inserting seed and protocol, it works! The settings for MCI-Iran that i use, and works, is this below code (from x-ui panel) (kcp does not work in Irancell and some ISPs) : "streamSettings": { "kcpSettings": { "congestion": true, "uplinkCapacity": 1, "downlinkCapacity": 100, "header": { "type": "dtls" }, "mtu": 1024, "tti": 50, "readBufferSize": 1, "seed": "jho8t2OFaR", "writeBufferSize": 1 }, "network": "kcp", "security": "none" }, "tag": "inbound-22615" },

To Reproduce Steps to reproduce the behavior:

  1. Use config on https://github.com/XTLS/Xray-examples/tree/main/VLESS-mKCPSeed or extract it from x-ui panel or use code below
  2. Implement it in Marzban Core Settings
  3. Export client side config and open it in V2rayN and you will see there is not any seed or header (empty)
  4. See error

Expected behavior It should transfer seed and header

Additional context Full working code for Marzban Core Setting (KCP) (tested on MCI-Iran) (but no seed and header in cliend side) (can be copied and past directly): { "log": { "loglevel": "warning" }, "routing": { "rules": [ { "ip": [ "geoip:private" ], "domain": [ "geosite:private" ], "protocol": [ "bittorrent" ], "outboundTag": "BLOCK", "type": "field" } ] }, "dns": null, "inbounds": [ { "tag": "Vless KCP", "listen": "0.0.0.0", "protocol": "vless", "port": 443, "settings": { "decryption": "none", "clients": [ { "id": "71bff48b-f9ad-445a-a543-9e1a252f445a" } ] }, "streamSettings": { "network": "kcp", "security": "none", "congestion": true, "uplinkCapacity": 1, "downlinkCapacity": 100, "mtu": 1024, "tti": 10, "header": { "type": "dtls" }, "kcpSettings": { "seed": "gsdyShu24F" } } } ], "outbounds": [ { "protocol": "freedom", "tag": "DIRECT" }, { "protocol": "blackhole", "tag": "BLOCK" } ] }

In Persian: کانفیگ بالا قابل کپی پیست در پنل مرزبان هست و خروجی اون در کلاینت کامپیوتر متاسفانه سید و همچنین نوع هدر رو انتقال نمیده و باید بصورت دستی در کلاینت وارد کرد. مثلا برای کد بالا در کلاینت بخش Path یا seed یا password عبارت gsdyShu24F
رو قرار بدید و نوع هدر رو هیچکدام یا دی تی ال اس قرار بدید و تست کنید (برای من در همراه اول کار میکند). ممنون میشم این باگ رو رفع کنین بتونیم استفاده کنیم. این پروتکل با قربانی کردن 10-20% حجم ترافیک بیشتر، 30-40% تاخیر کمتر داره و در شبکه همراه اول بخوبی کار میکنه. (اگر برای شما کار نکرد هم لطفا رفع کنید باگ رو، چون با تغییر پارامترها برای بقیه کار میکنه)

خلاصه مشکل: In Addition and in short words, Marzban panel KCP exported "config URL" is wrong, Marzban config and fixed correct config are shown below: Marzban Subscription KCP Exported Wrong Config Link is this: خروجی غلط پنل مرزبان برای کا سی پی این شکلی هست vless://--------UUID&IP--------:443?security=none&type=kcp&host=&headerType=&path=#Vless-KCP Correct Config Link would be something like this: در حالی که باید این شکلی باشه vless://--------UUID&IP--------:443?security=none&type=kcp&headerType=none&seed=gsdyShu24F#Vless-KCP It seems that "path" in kcp link should be changed to "seed" because i changed seed string to path in core settings and vless client config exported "path=xxxxxx" parameter, but client app does not import path from KCP configs! it imports only seed parameter! vless://--------UUID&IP--------:443?security=none&type=kcp&host=&headerType=&path=gsdyShu24F#Vless-KCP Code above contains seed password in {path} parameter but client apps does not accept it! it should contain {seed} parameter instead of {path}

منظور در خروجی پنل مرزبان پارامتر "مسیر" باید به پارامتر "سید" تغییر پیدا کنه تا برنامه های کلاینت اون رو بپذیرن و همچنین "هدر تایپ" مقدارش رو از تنظیمات هسته برداره و خالی نباشه تا کانفیگ کا ام سی روی مرزبان خروجی استاندارد و درست داده باشه

Screenshots Marzban x-ui-kcp

M03ED commented 1 month ago

04b75f610317867fd9876ee28dfda1378d39f481