mirror of
				https://github.com/xmdhs/natupnp.git
				synced 2025-10-31 10:27:03 +08:00 
			
		
		
		
	first commit
This commit is contained in:
		
							
								
								
									
										25
									
								
								main.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								main.go
									
									
									
									
									
										Normal 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)) | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 xmdhs
					xmdhs