github.com/TeaOSLab/EdgeNode@v1.3.8/internal/nodes/http_request_sub.go (about)

     1  // Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
     2  
     3  package nodes
     4  
     5  import "net/http"
     6  
     7  // 执行子请求
     8  func (this *HTTPRequest) doSubRequest(writer http.ResponseWriter, rawReq *http.Request) {
     9  	// 包装新请求对象
    10  	req := &HTTPRequest{
    11  		RawReq:     rawReq,
    12  		RawWriter:  writer,
    13  		ReqServer:  this.ReqServer,
    14  		ReqHost:    this.ReqHost,
    15  		ServerName: this.ServerName,
    16  		ServerAddr: this.ServerAddr,
    17  		IsHTTP:     this.IsHTTP,
    18  		IsHTTPS:    this.IsHTTPS,
    19  	}
    20  	req.isSubRequest = true
    21  	req.Do()
    22  }