@@ -11,11 +11,9 @@ import (
1111 "os"
1212 "path/filepath"
1313 "strconv"
14- "time"
1514
1615 "github.com/loft-sh/devpod/pkg/agent/tunnel"
1716 locald "github.com/loft-sh/devpod/pkg/daemon/local"
18- workspaced "github.com/loft-sh/devpod/pkg/daemon/workspace"
1917 network "github.com/loft-sh/devpod/pkg/daemon/workspace/network"
2018 devpodlog "github.com/loft-sh/devpod/pkg/log"
2119 "github.com/loft-sh/devpod/pkg/ts"
@@ -159,19 +157,9 @@ func handleGitCredentialsOverTSNet(ctx context.Context, writer http.ResponseWrit
159157 defer request .Body .Close ()
160158
161159 log .Infof ("Received git credentials post data: %s" , string (bodyBytes ))
162- // Set up HTTP transport that uses our network socket.
163- socketPath := filepath .Join (workspaced .RootDir , network .NetworkProxySocket )
164- transport := & http.Transport {
165- Dial : func (network , addr string ) (net.Conn , error ) {
166- return net .Dial ("unix" , socketPath )
167- },
168- }
169-
170- client := & http.Client {
171- Transport : transport ,
172- Timeout : 30 * time .Second , // TODO: extract this to config
173- }
174160
161+ // Create a DevPod network client to local credentials server
162+ client := network .GetClient ()
175163 credServerAddress := ts .EnsureURL (clientHost , locald .LocalCredentialsServerPort )
176164 targetURL := fmt .Sprintf ("http://%s%s" , credServerAddress , request .URL .RequestURI ())
177165
@@ -183,7 +171,7 @@ func handleGitCredentialsOverTSNet(ctx context.Context, writer http.ResponseWrit
183171 }
184172 newReq .Header = request .Header .Clone ()
185173
186- log .Infof ("Forwarding request to %s via socket %s " , targetURL , socketPath )
174+ log .Infof ("Forwarding request to %s" , targetURL )
187175
188176 // Execute the request.
189177 resp , err := client .Do (newReq )
0 commit comments