https://github.com/emersion/go-upnp-igd
Minimal Go UPnP InternetGatewayDevice library
https://github.com/emersion/go-upnp-igd
discovery gateway local-network nat upnp
Last synced: 8 months ago
JSON representation
Minimal Go UPnP InternetGatewayDevice library
- Host: GitHub
- URL: https://github.com/emersion/go-upnp-igd
- Owner: emersion
- License: mpl-2.0
- Created: 2017-09-18T13:10:42.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-07-14T13:03:08.000Z (almost 6 years ago)
- Last Synced: 2025-04-10T12:16:16.510Z (about 1 year ago)
- Topics: discovery, gateway, local-network, nat, upnp
- Language: Go
- Size: 30.3 KB
- Stars: 12
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-upnp-igd
[](https://godoc.org/github.com/emersion/go-upnp-igd)
Minimal Go UPnP InternetGatewayDevice library. Based on
[Syncthing's library](https://github.com/syncthing/syncthing/tree/e8ba6d477182a73ba417d0d69999a104d04cd912/lib/upnp).
## Usage
```go
package main
import (
"log"
"time"
"github.com/emersion/go-upnp-igd"
)
func main() {
devices := make(chan igd.Device)
go func() {
for d := range devices {
log.Println(d)
}
}()
err := igd.Discover(devices, 30*time.Second)
if err != nil {
log.Fatal(err)
}
}
```
## License
MPL 2.0