升级xray和sing版本

This commit is contained in:
wyx2685
2023-12-02 01:48:15 +09:00
parent 00d581d823
commit 3416284953
6 changed files with 49 additions and 26 deletions

View File

@@ -188,7 +188,7 @@ func (h *HookServer) Mode() string {
func (h *HookServer) StoreSelected() bool {
return false
}
func (h *HookServer) CacheFile() adapter.ClashCacheFile {
func (h *HookServer) CacheFile() adapter.CacheFile {
return nil
}
func (h *HookServer) HistoryStorage() *urltest.HistoryStorage {

View File

@@ -18,6 +18,14 @@ import (
F "github.com/sagernet/sing/common/format"
)
type HttpNetworkConfig struct {
Header struct {
Type string `json:"type"`
Request *json.RawMessage `json:"request"`
Response *json.RawMessage `json:"response"`
} `json:"header"`
}
type WsNetworkConfig struct {
Path string `json:"path"`
Headers map[string]string `json:"headers"`
@@ -95,7 +103,22 @@ func getInboundOptions(tag string, info *panel.NodeInfo, c *conf.Options) (optio
}
switch n.Network {
case "tcp":
t.Type = ""
if len(n.NetworkSettings) != 0 {
network := HttpNetworkConfig{}
err := json.Unmarshal(n.NetworkSettings, &network)
if err != nil {
return option.Inbound{}, fmt.Errorf("decode NetworkSettings error: %s", err)
}
if network.Header.Type == "http" {
t.Type = network.Header.Type
//Todo fix http options
//t.HTTPOptions.Host =
} else {
t.Type = ""
}
} else {
t.Type = ""
}
case "ws":
var (
path string