Pārlūkot izejas kodu

working on the proxying and HTTP request formation.

AETH-erial 1 gadu atpakaļ
vecāks
revīzija
0a0bb70396
2 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. 3 1
      pkg/controller.go
  2. 1 0
      pkg/include.go

+ 3 - 1
pkg/controller.go

@@ -40,6 +40,8 @@ func (c *Controller) Post(ctx *gin.Context) {
 	}
 	req.Header.Add("user-agent", c.Config.UserAgent)
 	req.Header.Add("Referer", c.Config.AllowedDomain)
-	req.Header.Add()
+	req.Host = c.Config.RevProxySite
+	req.Proto = ctx.Request.Method
+	req.RequestURI = ctx.FullPath()
 
 }

+ 1 - 0
pkg/include.go

@@ -11,6 +11,7 @@ type HttpServerConfig struct {
 	AllowedDomain string `json:"allowed_domain"`
 	UserAgent     string `json:"user_agent"`
 	UseSsl        bool   `json:"use_ssl"`
+	RevProxySite  string `json:"rev_proxy_site"`
 }
 
 type Cookie struct {