Add --skip-mdns to allow full bypassing of zeroconf. This allows operation within iOS
This commit is contained in:
parent
c909759d33
commit
620fd31b10
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,3 @@
|
|||||||
.idea/
|
.idea/
|
||||||
opensend
|
opensend
|
||||||
opensend-arm
|
opensend-*
|
||||||
|
13
main.go
13
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 {
|
||||||
// Register {hostname}._opensend._tcp.local. mDNS service and pass shutdown function
|
// If --skip-mdns is not given
|
||||||
zeroconfShutdown := RegisterService()
|
if !*skipMdns {
|
||||||
// Shutdown zeroconf server at the end of main()
|
// Register {hostname}._opensend._tcp.local. mDNS service and pass shutdown function
|
||||||
defer zeroconfShutdown()
|
zeroconfShutdown := RegisterService()
|
||||||
|
// Shutdown zeroconf server at the end of main()
|
||||||
|
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