first commit

This commit is contained in:
xmdhs
2023-05-21 18:11:50 +08:00
commit 5160eee387
7 changed files with 363 additions and 0 deletions

25
main.go Normal file
View File

@@ -0,0 +1,25 @@
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/xmdhs/natupnp/natmap"
)
func main() {
m, s, err := natmap.NatMap(context.Background(), "stun.sipnet.com:3478", "192.168.23.104", 9999, func(s string) {
log.Println(s)
})
if err != nil {
panic(err)
}
defer m.Close()
fmt.Println(s)
os.Stdin.Read(make([]byte, 1))
}