Add --skip-mdns to allow full bypassing of zeroconf. This allows operation within iOS
This commit is contained in:
		
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -1,3 +1,3 @@
 | 
				
			|||||||
.idea/
 | 
					.idea/
 | 
				
			||||||
opensend
 | 
					opensend
 | 
				
			||||||
opensend-arm
 | 
					opensend-*
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										5
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								main.go
									
									
									
									
									
								
							@@ -53,6 +53,8 @@ func main() {
 | 
				
			|||||||
	actionType := flag.String("t", "","Type of data being sent")
 | 
						actionType := flag.String("t", "","Type of data being sent")
 | 
				
			||||||
	// Create -d flag for data
 | 
						// Create -d flag for data
 | 
				
			||||||
	actionData := flag.String("d", "", "Data to send")
 | 
						actionData := flag.String("d", "", "Data to send")
 | 
				
			||||||
 | 
						// Create --skip-mdns to skip service registration
 | 
				
			||||||
 | 
						skipMdns := flag.Bool("skip-mdns", false, "Skip zeroconf service registration (use if mdns fails)")
 | 
				
			||||||
	// Create -s flag for sending
 | 
						// Create -s flag for sending
 | 
				
			||||||
	sendFlag := flag.Bool("s", false, "Send data")
 | 
						sendFlag := flag.Bool("s", false, "Send data")
 | 
				
			||||||
	// Create -r flag for receiving
 | 
						// Create -r flag for receiving
 | 
				
			||||||
@@ -136,10 +138,13 @@ func main() {
 | 
				
			|||||||
		SendFiles(opensendDir)
 | 
							SendFiles(opensendDir)
 | 
				
			||||||
	// If -r given
 | 
						// If -r given
 | 
				
			||||||
	} else if *recvFlag {
 | 
						} else if *recvFlag {
 | 
				
			||||||
 | 
							// If --skip-mdns is not given
 | 
				
			||||||
 | 
							if !*skipMdns {
 | 
				
			||||||
			// Register {hostname}._opensend._tcp.local. mDNS service and pass shutdown function
 | 
								// Register {hostname}._opensend._tcp.local. mDNS service and pass shutdown function
 | 
				
			||||||
			zeroconfShutdown := RegisterService()
 | 
								zeroconfShutdown := RegisterService()
 | 
				
			||||||
			// Shutdown zeroconf server at the end of main()
 | 
								// Shutdown zeroconf server at the end of main()
 | 
				
			||||||
			defer zeroconfShutdown()
 | 
								defer zeroconfShutdown()
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		// Notify user opensend is waiting for key exchange
 | 
							// Notify user opensend is waiting for key exchange
 | 
				
			||||||
		log.Info().Msg("Waiting for sender key exchange")
 | 
							log.Info().Msg("Waiting for sender key exchange")
 | 
				
			||||||
		// Generate keypair
 | 
							// Generate keypair
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user