refactoring: moved reverse_proxy to separate package to avoid import cycle

This commit is contained in:
yusing
2025-01-08 12:04:11 +08:00
parent 577a5366e8
commit bc1702e6cf
8 changed files with 76 additions and 72 deletions

View File

@@ -4,6 +4,7 @@ import (
"net/http"
gphttp "github.com/yusing/go-proxy/internal/net/http"
"github.com/yusing/go-proxy/internal/net/http/reverseproxy"
)
// internal use only.
@@ -13,7 +14,7 @@ type setUpstreamHeaders struct {
var suh = NewMiddleware[setUpstreamHeaders]()
func newSetUpstreamHeaders(rp *gphttp.ReverseProxy) *Middleware {
func newSetUpstreamHeaders(rp *reverseproxy.ReverseProxy) *Middleware {
m, err := suh.New(OptionsRaw{
"name": rp.TargetName,
"scheme": rp.TargetURL.Scheme,