WIP: Simple working client/server
This commit is contained in:
		
							
								
								
									
										7
									
								
								stage1/cmd/client/build.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										7
									
								
								stage1/cmd/client/build.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| go build | ||||
|  | ||||
| scp client kevin:/home/jdl/tmp | ||||
| ssh root@home "setcap cap_net_admin+iep /home/jdl/tmp/client" | ||||
| ssh home "/home/jdl/tmp/client 192.168.1.21" | ||||
							
								
								
									
										14
									
								
								stage1/cmd/client/main.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								stage1/cmd/client/main.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| package main | ||||
|  | ||||
| import ( | ||||
| 	"log" | ||||
| 	"os" | ||||
| 	"vppn/stage1" | ||||
| ) | ||||
|  | ||||
| func main() { | ||||
| 	if len(os.Args) != 2 { | ||||
| 		log.Fatalf("Usage: %s <addr:port>", os.Args[0]) | ||||
| 	} | ||||
| 	stage1.RunClient(os.Args[1]) | ||||
| } | ||||
							
								
								
									
										4
									
								
								stage1/cmd/server/build.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										4
									
								
								stage1/cmd/server/build.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| go build | ||||
| sudo setcap cap_net_admin+iep server | ||||
							
								
								
									
										14
									
								
								stage1/cmd/server/main.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								stage1/cmd/server/main.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| package main | ||||
|  | ||||
| import ( | ||||
| 	"log" | ||||
| 	"os" | ||||
| 	"vppn/stage1" | ||||
| ) | ||||
|  | ||||
| func main() { | ||||
| 	if len(os.Args) != 2 { | ||||
| 		log.Fatalf("Usage: %s <addr>", os.Args[0]) | ||||
| 	} | ||||
| 	stage1.RunServer(os.Args[1]) | ||||
| } | ||||
		Reference in New Issue
	
	Block a user