func useUPnP() bool {
	nt, err := nat.NewNetStatus()
	if err != nil {
		log.Println(err)
		return false
	}
	log.Println("openning port by upnp...")
	ma, err := nt.LoopPortMapping("tcp", cfg.DefaultPort, "shingetsu-gou", 10*time.Minute)
	if err != nil {
		log.Println(err)
		return false
	}
	log.Println("openned port by upnp.")
	externalPort = ma.ExternalPort
	return true
}
useUPnP gets external port by upnp and return external port.
returns defaultPort if failed.
package myself
import (
	"log"
	"net"
	"sync"
	"time"
	nat "github.com/shingetsu-gou/go-nat"
	"github.com/shingetsu-gou/shingetsu-gou/cfg"
)
var ip string
var externalPort *int32
var mutex sync.RWMutex
var status int
func init() {
	resetConnection()
}
func resetConnection() {
	mutex.Lock()
	defer mutex.Unlock()
	p := int32(cfg.DefaultPort)
	externalPort = &p
	status = cfg.Disconnected
}
func GetStatus() int {
	mutex.RLock()
	defer mutex.RUnlock()
	return status
}
func SetStatus(stat int) {
	mutex.Lock()
	status = stat
	mutex.Unlock()
}
func GetIPPort() (string, int32) {
	mutex.RLock()
	defer mutex.RUnlock()
	return ip, *externalPort
}
func SetIP(ips string) {
	mutex.Lock()
	defer mutex.Unlock()
	var nip net.IP
	if nip = net.ParseIP(ips); nip == nil {
		log.Println("ip", ips, "is illegal format")
		return
	}
	if nat.IsGlobalIP(nip) != "" {
		ip = ips
	}
}