mirror of
https://github.com/mudler/edgevpn.git
synced 2025-10-24 09:03:38 +08:00
⚙️ Construct from client the socket dialer
This commit is contained in:
@@ -19,8 +19,6 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
@@ -44,13 +42,7 @@ var _ = Describe("API", func() {
|
||||
os.MkdirAll(d, os.ModePerm)
|
||||
socket := filepath.Join(d, "socket")
|
||||
|
||||
c := client.NewClient(client.WithHost("http://unix"), client.WithHTTPClient(&http.Client{
|
||||
Transport: &http.Transport{
|
||||
DialContext: func(_ context.Context, _, _ string) (net.Conn, error) {
|
||||
return net.Dial("unix", socket)
|
||||
},
|
||||
},
|
||||
}))
|
||||
c := client.NewClient(client.WithHost("unix://" + socket))
|
||||
|
||||
token := node.GenerateNewConnectionData().Base64()
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
|
||||
Reference in New Issue
Block a user