tendermint/cmd/probe_upnp.go

25 lines
373 B
Go
Raw Normal View History

2014-12-23 17:20:52 -08:00
package main
import (
"encoding/json"
"fmt"
2015-03-30 22:50:27 -07:00
"github.com/tendermint/tendermint2/p2p/upnp"
2014-12-23 17:20:52 -08:00
)
func probe_upnp() {
capabilities, err := upnp.Probe()
if err != nil {
fmt.Println("Probe failed: %v", err)
} else {
fmt.Println("Probe success!")
jsonBytes, err := json.Marshal(capabilities)
if err != nil {
panic(err)
}
fmt.Println(string(jsonBytes))
}
}