Skip to content

Commit

Permalink
fix tunnel
Browse files Browse the repository at this point in the history
  • Loading branch information
asim committed Mar 21, 2022
1 parent e681b23 commit c9001a0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tunnel/handler/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,11 @@ func (e *Tunnel) Send(ctx context.Context, req *pb.SendRequest, rsp *pb.SendResp

// use a proxy if specified
if len(e.Proxy) > 0 {
proxyUrl, _ := url.Parse(e.Proxy)
client = &http.Client{Transport: &http.Transport{Proxy: http.ProxyURL(proxyUrl)}}
hreq.Header.Set("Micro-Endpoint", fmt.Sprintf("%s://%s", uri.Scheme, uri.Host))

// reset the host
hreq.URL.Host = proxyUrl.Host
hreq.Host = proxyUrl.Host
hreq.URL.Host = e.Proxy
hreq.Host = e.Proxy
}

// set the authorization token
Expand Down

0 comments on commit c9001a0

Please sign in to comment.