alireza0 / x-ui

xray panel supporting multi-protocol multi-user expire day & traffic (Vmess & Vless & Trojan & Shadowsocks)
https://t.me/XrayUI
GNU General Public License v3.0
3.22k stars 492 forks source link

HTTPUpgrade host field #1154

Closed pulsarice closed 7 months ago

pulsarice commented 7 months ago

There's something wrong in HTTPUpgrade host field parsing that deletes host after editing an existing outbound.

To recreate the bug:

  1. add an outbound using xray-outbounds menu.
  2. set transmission to HTTPUpgrade and fill the fields, including the Host field and press Sure button.
  3. check xray-advanced-outbounds json: Host field and host header are set.
  4. now go back to xray-outbounds menu and edit the newly created outbound. Host field is now empty.
  5. If you press sure, the Host settings will be also deleted from xray-advanced-outbounds json.

By the way, I'm not sure that putting "Host" field in "headers" is necessary

      "httpupgradeSettings": {
        "path": "/path",
        "host": "somehost",
        "headers": {
          "Host": "somehost"
        }
alireza0 commented 7 months ago

Regarding no2 : Host header is not defined for HttpUpgrade in last version! Regarding no4, it is fixed now and will be okay in next version.

pulsarice commented 7 months ago

Regarding no2 : Host header is not defined for HttpUpgrade in last version!

That's my bad. I was testing multiple panels and one of them was 3x-ui. I confirm that host header is empty on x-ui and is only defined in 3x-ui.

Regarding no4, it is fixed now and will be okay in next version.

Thank you sir.

X-Oracle commented 7 months ago

Hi @alireza0 . Is this backward compatibality with older version of x-ray cores like 1.8.4? Or we have to use 1 8.10+ in next panel release?

pulsarice commented 7 months ago

It's introduced in xray-core v1.8.9 so you have be at least on this version

alireza0 commented 7 months ago

It has backward compatibility. But in x-ui, using links and qr-code will be affected.

X-Oracle commented 7 months ago

It has backward compatibility. But in x-ui, using links and qr-code will be affected.

I'm kinda confused.

what I meant was about x-ui inbound generator. I see that the Host moved from headers which is not compatible with older versions. my question is will it be able to make configs base on the active xray-core version?

I'm asking since in recent updates some memory and unnecessary disconnection is detected so I don't want to update to these versions right now.

alireza0 commented 7 months ago

@X-Oracle I have added a kind of backward compatibility to support both.