mirror of
https://github.com/fumiama/water.git
synced 2026-06-25 06:20:29 +08:00
Update README.md (resolves #16)
This commit is contained in:
17
README.md
17
README.md
@@ -15,7 +15,7 @@ See https://github.com/songgao/packets for functions for parsing various packets
|
|||||||
## Supported Platforms
|
## Supported Platforms
|
||||||
|
|
||||||
* Linux
|
* Linux
|
||||||
* Windows
|
* Windows (experimental; APIs might change)
|
||||||
* macOS (point-to-point TUN only)
|
* macOS (point-to-point TUN only)
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
@@ -42,7 +42,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ifce, err := water.NewTAP("O_O")
|
config := water.Config{
|
||||||
|
DeviceType: water.TAP,
|
||||||
|
}
|
||||||
|
config.Name = "O_O"
|
||||||
|
|
||||||
|
ifce, err := water.New(config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -101,7 +106,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ifce, err := water.NewTUN("")
|
ifce, err := water.New(water.Config{
|
||||||
|
DeviceType: water.TUN,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -161,7 +168,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ifce, err := water.NewTAP("O_O")
|
ifce, err := water.New(water.Config{
|
||||||
|
DeviceType: water.TAP,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user