You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
372 B

  1. package main
  2. import (
  3. "encoding/json"
  4. "fmt"
  5. "github.com/tendermint/tendermint/p2p/upnp"
  6. )
  7. func probe_upnp() {
  8. capabilities, err := upnp.Probe()
  9. if err != nil {
  10. fmt.Println("Probe failed: %v", err)
  11. } else {
  12. fmt.Println("Probe success!")
  13. jsonBytes, err := json.Marshal(capabilities)
  14. if err != nil {
  15. panic(err)
  16. }
  17. fmt.Println(string(jsonBytes))
  18. }
  19. }