croc icon indicating copy to clipboard operation
croc copied to clipboard

When using the --local option to force the use of a local connection, local sending and receiving of a single host cannot be achieved.

Open xxbdh opened this issue 1 year ago • 4 comments

Describe the bug

<-- A clear and concise description of what the bug is. --> Only test croc on one host. When you do not use the --local option, you can send and receive normally through the default relay. After using the --local option, the sender's command line window prompts that the connection is established normally, and the receiver's command line window prompts room not ready. Tried turning off the local host's firewall, but no solution

To Reproduce

1.The sender outputs the following information after using the command line

C:\Users\Administrator>croc --debug --local --testing send vmlogs [debug] 11:35:46 cli.go:150: debug mode on [debug] 11:35:46 croc.go:185: options: {IsSender:true SharedSecret:0801-equal-habitat-libra Debug:true RelayAddress:5.78 .91.237:9009 RelayAddress6: RelayPorts:[9009 9010 9011 9012 9013] RelayPassword:pass123 Stdout:false NoPrompt:false NoMu ltiplexing:false DisableLocal:false OnlyLocal:true IgnoreStdin:false Ask:false SendingText:false NoCompress:false IP: Ov erwrite:false Curve:p256 HashAlgorithm:xxhash ThrottleUpload: ZipFolder:false TestFlag:false GitIgnore:false} [debug] 11:35:46 croc.go:499: hashed C:\Users\Administrator\vmlogs\nox.log to b262e720119e7160 using xxhash [debug] 11:35:46 croc.go:504: file 0 info: {Name:nox.log FolderRemote:vmlogs/ FolderSource:C:\Users\Administrator\vmlogs Hash:[178 98 231 32 17 158 113 96] Size:8840 ModTime:2023-07-24 22:37:00.4474559 +0800 CST IsCompressed:false IsEncrypt ed:false Symlink: Mode:-rw-rw-rw- TempFile:false IsIgnored:false} Sending 0 files (8.6 kB)[debug] 11:35:46 croc.go:499: hashed C:\Users\Administrator\vmlogs\nox.log.1 to 24d9bd5e4e5762b4 using xxhash [debug] 11:35:46 croc.go:504: file 1 info: {Name:nox.log.1 FolderRemote:vmlogs/ FolderSource:C:\Users\Administrator\vmlo gs Hash:[36 217 189 94 78 87 98 180] Size:7576 ModTime:2022-12-14 12:44:45.4161557 +0800 CST IsCompressed:false IsEncryp ted:false Symlink: Mode:-rw-rw-rw- TempFile:false IsIgnored:false} Sending 1 files (16.0 kB)[debug] 11:35:46 croc.go:508: longestFilename: 9 Sending 2 files and 1 folders (16.0 kB) Code is: 0801-equal-habitat-libra On the other computer run

croc 0801-equal-habitat-libra [debug] 11:35:46 tcp.go:59: starting with password 'pass123' [info] 2024/02/20 11:35:46 starting TCP server on 0.0.0.0:9009 [debug] 11:35:46 tcp.go:59: starting with password 'pass123' [info] 2024/02/20 11:35:46 starting TCP server on 0.0.0.0:9012 [debug] 11:35:46 tcp.go:59: starting with password 'pass123' [info] 2024/02/20 11:35:46 starting TCP server on 0.0.0.0:9013 [debug] 11:35:46 tcp.go:59: starting with password 'pass123' [info] 2024/02/20 11:35:46 starting TCP server on 0.0.0.0:9011 [debug] 11:35:46 tcp.go:59: starting with password 'pass123' [info] 2024/02/20 11:35:46 starting TCP server on 0.0.0.0:9010 [debug] 11:35:46 croc.go:583: establishing connection [debug] 11:35:46 comm.go:78: dialing to 127.0.0.1:9009 with timelimit 30s [debug] 11:35:46 comm.go:87: connected to '127.0.0.1:9009' [debug] 11:35:46 tcp.go:125: client 127.0.0.1:52708 connected [debug] 11:35:46 tcp.go:188: Abytes: {"Role":0,"Uᵤ":793136080485469241208656611513609866400481671853,"Uᵥ":18458907634222 644275952014841865282643645472623913459400556233196838128612339,"Vᵤ":1086685267857089638167386722555472967068468061489," Vᵥ":19593504966619549205903364028255899745298716108914514072669075231742699650911,"Xᵤ":371792124005082036827838572857261 0920361411594495064313369536361889777103558,"Xᵥ":12926367975941883910278201387974725002008857232778764507472125842053779 564617,"Yᵤ":null,"Yᵥ":null,"P":null,"Pw":null,"Vpwᵤ":null,"Vpwᵥ":null,"Upwᵤ":null,"Upwᵥ":null,"Aα":null,"Aαᵤ":null,"A αᵥ":null,"Zᵤ":null,"Zᵥ":null,"K":null} [debug] 11:35:47 tcp.go:207: strongkey: d5e86fdb10ba87ecd8fe6228aa64aec34d4d9b322a3e26f053fdbece4c418d45 [debug] 11:35:47 tcp.go:476: strong key: d5e86fdb10ba87ecd8fe6228aa64aec34d4d9b322a3e26f053fdbece4c418d45 [debug] 11:35:47 tcp.go:490: sending password [debug] 11:35:47 tcp.go:219: waiting for password [debug] 11:35:47 tcp.go:501: waiting for first ok [debug] 11:35:47 tcp.go:242: sending '9010,9011,9012,9013' [debug] 11:35:47 tcp.go:253: waiting for answer [debug] 11:35:47 tcp.go:519: sending room [debug] 11:35:47 tcp.go:530: waiting for room confirmation [debug] 11:35:47 tcp.go:284: room 080 has 1 [debug] 11:35:47 tcp.go:129: room: 080 [debug] 11:35:47 tcp.go:546: all set [debug] 11:35:47 croc.go:586: banner: 9010,9011,9012,9013 [debug] 11:35:47 tcp.go:130: err: [debug] 11:35:47 tcp.go:143: checking connection of room 080 for &{connection:0xc0002ac008} [debug] 11:35:47 croc.go:593: local connection established: &{connection:0xc00004a0d0} [debug] 11:35:47 tcp.go:151: room: {first:0xc000202db0 second: opened:{wall:13937837536481666436 ext:913987501 loc: 0x1174a00} full:false} [debug] 11:35:47 croc.go:599: got ping [debug] 11:35:48 tcp.go:143: checking connection of room 080 for &{connection:0xc0002ac008} [debug] 11:35:48 tcp.go:151: room: {first:0xc000202db0 second: opened:{wall:13937837536481666436 ext:913987501 loc: 0x1174a00} full:false} [debug] 11:35:48 croc.go:599: got ping [debug] 11:35:49 tcp.go:143: checking connection of room 080 for &{connection:0xc0002ac008} [debug] 11:35:49 tcp.go:151: room: {first:0xc000202db0 second: opened:{wall:13937837536481666436 ext:913987501 loc: 0x1174a00} full:false} [debug] 11:35:49 croc.go:599: got ping [debug] 11:35:50 tcp.go:143: checking connection of room 080 for &{connection:0xc0002ac008} [debug] 11:35:50 tcp.go:151: room: {first:0xc000202db0 second: opened:{wall:13937837536481666436 ext:913987501 loc: 0x1174a00} full:false}

2.The receiver outputs the following information after using the command line

D:\Test> croc --debug 0801-equal-habitat-libra [debug] 11:37:44 cli.go:150: debug mode on [debug] 11:37:44 croc.go:185: options: {IsSender:false SharedSecret:0801-equal-habitat-libra Debug:true RelayAddress:5.7 8.91.237:9009 RelayAddress6: RelayPorts:[] RelayPassword:pass123 Stdout:false NoPrompt:false NoMultiplexing:false Disabl eLocal:false OnlyLocal:false IgnoreStdin:false Ask:false SendingText:false NoCompress:false IP: Overwrite:false Curve:p2 56 HashAlgorithm: ThrottleUpload: ZipFolder:false TestFlag:false GitIgnore:false} connecting...[debug] 11:37:44 croc.go:785: attempt to discover peers [debug] 11:37:46 croc.go:850: discoveries: [] [debug] 11:37:46 croc.go:851: establishing connection [debug] 11:37:46 croc.go:867: got host '5.78.91.237' and port '9009' [debug] 11:37:46 croc.go:869: trying connection to 5.78.91.237:9009 [debug] 11:37:46 comm.go:78: dialing to 5.78.91.237:9009 with timelimit 5s [debug] 11:37:46 comm.go:87: connected to '5.78.91.237:9009' [debug] 11:37:46 tcp.go:476: strong key: b67d99c60186327550ea31067fefb2c6f027ace6ce7d8ab31929f413824eb803 [debug] 11:37:46 tcp.go:490: sending password [debug] 11:37:46 tcp.go:501: waiting for first ok [debug] 11:37:47 tcp.go:519: sending room [debug] 11:37:47 tcp.go:530: waiting for room confirmation [debug] 11:37:47 tcp.go:546: all set [debug] 11:37:47 croc.go:882: receiver connection established: &{connection:0xc00004a060} [debug] 11:37:47 croc.go:883: banner: 9010,9011,9012,9013 [debug] 11:37:47 croc.go:891: sending ips? [debug] 11:37:47 croc.go:900: ips data: [debug] 11:37:47 croc.go:903: ips unmarshal error: invalid character '\x01' looking for beginning of value [debug] 11:37:47 croc.go:956: exchanged header message securing channel...[debug] 11:37:47 croc.go:974: ready [debug] 11:37:47 message.go:61: writing pake message (unencrypted) [debug] 11:37:48 compress.go:50: error copying data: unexpected EOF [debug] 11:37:48 croc.go:1326: problem with decoding: unexpected end of JSON input [debug] 11:37:48 croc.go:1000: got error processing: problem with decoding: unexpected end of JSON input [debug] 11:37:48 croc.go:1054: error: problem with decoding: unexpected end of JSON input 2024/02/20 11:37:48 room not ready

Expected behaviour

<-- A clear and concise description of what you expected to happen. --> When using the --local option, local files on a single host can be sent and received normally.

Version

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

Additional context

<-- Add any other context about the problem here. -->

xxbdh avatar Feb 20 '24 04:02 xxbdh

are sender and receiver on same LAN

schollz avatar Feb 20 '24 04:02 schollz

The sender and receiver are on the same host

Output after trying again using the --local option on the receiver command line

D:\Test>croc --debug --local 7448-beast-balloon-sabrina [debug] 14:01:41 cli.go:150: debug mode on [debug] 14:01:41 croc.go:185: options: {IsSender:false SharedSecret:7448-beast-balloon-sabrina Debug:true RelayAddress:5 .78.91.237:9009 RelayAddress6: RelayPorts:[] RelayPassword:pass123 Stdout:false NoPrompt:false NoMultiplexing:false Disa bleLocal:false OnlyLocal:true IgnoreStdin:false Ask:false SendingText:false NoCompress:false IP: Overwrite:false Curve:p 256 HashAlgorithm: ThrottleUpload: ZipFolder:false TestFlag:false GitIgnore:false} connecting...[debug] 14:01:41 croc.go:785: attempt to discover peers [debug] 14:01:42 croc.go:850: discoveries: [] [debug] 14:01:42 croc.go:851: establishing connection [debug] 14:01:42 croc.go:879: could not connect to : found no addresses to connect 2024/02/20 14:01:42 could not connect to : found no addresses to connect

xxbdh avatar Feb 20 '24 05:02 xxbdh

are both crocs the same version?

schollz avatar Feb 20 '24 17:02 schollz

are both crocs the same version?

Yes. The sender and receiver use the same program.

I also tested reception on another host on the same network. When the sender uses the --local option, the receiver can receive normally without using the --local option, but cannot receive normally with the --local option, prompting "could not connect to: found no addresses to connect"

xxbdh avatar Feb 21 '24 00:02 xxbdh

Stale issue message

github-actions[bot] avatar Apr 21 '24 12:04 github-actions[bot]