mirror of
https://github.com/wyx2685/V2bX.git
synced 2025-01-22 18:08:14 -05:00
Try to fix vmess/vless tcp http
This commit is contained in:
parent
a25c3d2759
commit
1f6cccbb9f
@ -26,6 +26,15 @@ type HttpNetworkConfig struct {
|
|||||||
} `json:"header"`
|
} `json:"header"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type HttpRequest struct {
|
||||||
|
Version string `json:"version"`
|
||||||
|
Method string `json:"method"`
|
||||||
|
Path []string `json:"path"`
|
||||||
|
Headers struct {
|
||||||
|
Host []string `json:"Host"`
|
||||||
|
} `json:"headers"`
|
||||||
|
}
|
||||||
|
|
||||||
type WsNetworkConfig struct {
|
type WsNetworkConfig struct {
|
||||||
Path string `json:"path"`
|
Path string `json:"path"`
|
||||||
Headers map[string]string `json:"headers"`
|
Headers map[string]string `json:"headers"`
|
||||||
@ -109,10 +118,19 @@ func getInboundOptions(tag string, info *panel.NodeInfo, c *conf.Options) (optio
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return option.Inbound{}, fmt.Errorf("decode NetworkSettings error: %s", err)
|
return option.Inbound{}, fmt.Errorf("decode NetworkSettings error: %s", err)
|
||||||
}
|
}
|
||||||
|
//Todo fix http options
|
||||||
if network.Header.Type == "http" {
|
if network.Header.Type == "http" {
|
||||||
t.Type = network.Header.Type
|
t.Type = network.Header.Type
|
||||||
//Todo fix http options
|
var request HttpRequest
|
||||||
//t.HTTPOptions.Host =
|
if network.Header.Request != nil {
|
||||||
|
err = json.Unmarshal(*network.Header.Request, &request)
|
||||||
|
if err != nil {
|
||||||
|
return option.Inbound{}, fmt.Errorf("decode HttpRequest error: %s", err)
|
||||||
|
}
|
||||||
|
t.HTTPOptions.Host = request.Headers.Host
|
||||||
|
t.HTTPOptions.Path = request.Path[0]
|
||||||
|
t.HTTPOptions.Method = request.Method
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
t.Type = ""
|
t.Type = ""
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user