schollz / croc

Easily and securely send things from one computer to another :crocodile: :package:
https://schollz.com/software/croc6
MIT License
26.78k stars 1.07k forks source link

Send/Receive --local fails, firewall issue? #694

Closed zz0rk closed 1 month ago

zz0rk commented 1 month ago

Describe the bug

<-- A clear and concise description of what the bug is. --> Attempting to send a file locally over the LAN from host A to host B fails on host B (receiver) with error. Sending files from host A to B through the default relay succeeds.

To Reproduce

Steps to reproduce the behavior: <-- 1. Go to '...'

  1. Click on '....'

  2. Scroll down to '....'

  3. See error -->

  4. Host A (sender): croc --local send

  5. Host A generates code

  6. Host B (receiver): croc --local

  7. Host B generates error

Expected behaviour

<-- A clear and concise description of what you expected to happen. --> Host B (receiver) should download file.

Version

<-- Check "croc -v" and report it --> croc v9.6.15

Additional context

<-- Add any other context about the problem here. --> Both hosts are on the same LAN and subnet. Both hosts run the same version of croc. Both hosts run Debian 12.

Sender & Receiver: Debian 12 & croc v9.6.15

Send Local Debug (debug.log):

user@sender:/mnt/02/ISOIMG$ croc --debug --local send debian-12.5.0-amd64-netinst.iso >> debug.log                                         
Sending 'debian-12.5.0-amd64-netinst.iso' (629.0 MB)                                                                                                     
Code is: 4542-phantom-nickel-herbert                                                                                                                     
On the other computer run                                                                                                                                

croc 4542-phantom-nickel-herbert

Receive Local Debug:

user@receiver:~/Downloads$ croc --debug --local 
[debug] 19:24:08 cli.go:150: debug mode on
Enter receive code: 4542-phantom-nickel-herbert
[debug] 19:24:12 croc.go:185: options: {IsSender:false SharedSecret:4542-phantom-nickel-herbert Debug:true RelayAddress:5.78.91.237:9009 RelayAddress6:[2a01:4ff:1f0:c10b::1]:9009 RelayPorts:[] RelayPassword:pass123 Stdout:false NoPrompt:false NoMultiplexing:false DisableLocal:false OnlyLocal:true IgnoreStdin:false Ask:false SendingText:false NoCompress:false IP: Overwrite:false Curve:p256 HashAlgorithm: ThrottleUpload: ZipFolder:false TestFlag:false GitIgnore:false}
connecting...[debug]    19:24:12 croc.go:785: attempt to discover peers
[debug] 19:24:12 croc.go:850: discoveries: []
[debug] 19:24:12 croc.go:851: establishing connection
[debug] 19:24:12 croc.go:879: could not connect to : found no addresses to connect
2024/05/04 19:24:12 could not connect to : found no addresses to connect
user@receiver:~/Downloads$ 
schollz commented 1 month ago

test this package on both computers: https://github.com/schollz/peerdiscovery/

zz0rk commented 1 month ago

I've installed golang from the repository. The version is 1.19. The most current version available from the official Go dev website is 1.22.x. When I try to install peerdiscovery I get the following error:

go get -u github.com/schollz/peerdiscovery               │
go: go.mod file not found in current directory or any parent directory.        │
        'go get' is no longer supported outside a module.                      │
        To build and install a command, use 'go install' with a version,       │
        like 'go install example.com/cmd@latest'                               │
        For more information, see https://golang.org/doc/go-get-install-depreca│
tion                                                                           │
        or run 'go help get' or 'go help install'.