emersion / go-upnp-igd

Minimal Go UPnP InternetGatewayDevice library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-upnp-igd

GoDoc

Minimal Go UPnP InternetGatewayDevice library. Based on Syncthing's library.

Usage

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

About

Minimal Go UPnP InternetGatewayDevice library

License:Mozilla Public License 2.0


Languages

Language:Go 100.0%