File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -234,6 +234,7 @@ type SplitHTTPConfig struct {
234234 Xmux Xmux `json:"xmux"`
235235 DownloadSettings * StreamConfig `json:"downloadSettings"`
236236 Mode string `json:"mode"`
237+ Extra json.RawMessage `json:"extra"`
237238}
238239
239240type Xmux struct {
@@ -259,6 +260,18 @@ func splithttpNewRandRangeConfig(input *Int32Range) *splithttp.RandRangeConfig {
259260
260261// Build implements Buildable.
261262func (c * SplitHTTPConfig ) Build () (proto.Message , error ) {
263+ if c .Extra != nil {
264+ var extra SplitHTTPConfig
265+ if err := json .Unmarshal (c .Extra , & extra ); err != nil {
266+ return nil , errors .New (`Failed to unmarshal "extra".` ).Base (err )
267+ }
268+ extra .Host = c .Host
269+ extra .Path = c .Path
270+ extra .Mode = c .Mode
271+ extra .Extra = c .Extra
272+ c = & extra
273+ }
274+
262275 // If http host is not set in the Host field, but in headers field, we add it to Host Field here.
263276 // If we don't do that, http host will be overwritten as address.
264277 // Host priority: Host field > headers field > address.
@@ -312,6 +325,9 @@ func (c *SplitHTTPConfig) Build() (proto.Message, error) {
312325 }
313326 var err error
314327 if c .DownloadSettings != nil {
328+ if c .Extra != nil {
329+ c .DownloadSettings .SocketSettings = nil
330+ }
315331 if config .DownloadSettings , err = c .DownloadSettings .Build (); err != nil {
316332 return nil , errors .New (`Failed to build "downloadSettings".` ).Base (err )
317333 }
You can’t perform that action at this time.
0 commit comments