Skip to content

Commit 838e788

Browse files
committed
Setup HTTP automatically
1 parent c09e2c3 commit 838e788

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

dial_wasip1.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@ import (
44
"context"
55
"fmt"
66
"net"
7+
"net/http"
78
"os"
89

910
"github.com/stealthrocket/net/syscall"
1011
)
1112

1213
func init() {
1314
net.DefaultResolver.Dial = DialContext
15+
16+
if t, ok := http.DefaultTransport.(*http.Transport); ok {
17+
t.DialContext = DialContext
18+
}
1419
}
1520

1621
// Conn is a generic stream-oriented network connection.

0 commit comments

Comments
 (0)