|
1 | 1 | # net |
2 | 2 |
|
3 | 3 | This library provides `net.Dial` and `net.Listen` functions |
4 | | -for `GOOS=wasip1`. It uses the WasmEdge sockets extension to WASI |
5 | | -preview 1. |
| 4 | +for `GOOS=wasip1` |
6 | 5 |
|
7 | 6 | Applications built with this library are compatible with WasmEdge |
8 | 7 | and [stealthrocket/wasi-go](https://github.com/stealthrocket/wasi-go). |
9 | 8 |
|
10 | 9 | ## Dialing |
11 | 10 |
|
12 | 11 | The library will automatically configure the default HTTP transport |
13 | | -to use the `Dial` function from this library. To make outbound HTTP |
14 | | -connections you just need the following import somewhere: |
| 12 | +to use the `Dial` function from this library |
| 13 | + |
| 14 | +To make outbound HTTP connections you just need the following import somewhere: |
15 | 15 |
|
16 | 16 | ```go |
17 | 17 | import _ "github.com/stealthrocket/net" |
@@ -43,7 +43,7 @@ func main() { |
43 | 43 | } |
44 | 44 | ``` |
45 | 45 |
|
46 | | -For example, to connect to Redis: |
| 46 | +and to connect to Redis: |
47 | 47 |
|
48 | 48 | ```go |
49 | 49 | import ( |
@@ -90,15 +90,13 @@ for a hostname. |
90 | 90 | ### getaddrinfo |
91 | 91 |
|
92 | 92 | The `sock_getaddrinfo` host function is used to implement name resolution. |
93 | | -This requires WasmEdge, or a WasmEdge compatible WASI layer |
94 | | -(e.g. [wasi-go](http://github.com/stealthrocket/wasi-go)). |
95 | 93 |
|
96 | 94 | When using this method, the standard library resolver **will not work**. You |
97 | | -_cannot_ use `net.DefaultResolver`, `net.LookupIP`, etc. with this approach |
| 95 | +cannot use `net.DefaultResolver`, `net.LookupIP`, etc. with this approach |
98 | 96 | because the standard library does not allow us to patch it with an alternative |
99 | 97 | implementation. |
100 | 98 |
|
101 | | -Note that `sock_getaddrinfo` may block! |
| 99 | +Note that `sock_getaddrinfo` may block. |
102 | 100 |
|
103 | 101 | ### Pure Go Resolver |
104 | 102 |
|
|
0 commit comments