Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Included nc command does not support -u Please Update #115

Open
whitedavidp opened this issue Apr 15, 2022 · 4 comments
Open

Included nc command does not support -u Please Update #115

whitedavidp opened this issue Apr 15, 2022 · 4 comments

Comments

@whitedavidp
Copy link

Hello and thanks for this fine app and for LinuxDeploy. I use this version of BusyBox because it seems necessary for LinuxDeploy and it seems to work quite well. But I recently had a need to do something like this:

/bin/echo -e -n LSD_WIFI:AT+Z\x0d | nc -u -p 8800 -w 2 192.168.1.x 8800

And it fails here saying unknown option -u.

I have Stericson 1.31.1 on my phone it and has this ability. I just updated to the very newest version of yours (1.34.1) and expected that was needed to get this. Sadly, it seems that more in needed. Is this possible to do/get?

Thanks

@superbonaci
Copy link

This is the help menu for me, does it help:

1|android:/ $ nc --help
nc --help
usage: netcat [-46Ut] [-lL COMMAND...] [-u] [-wpq #] [-s addr] {IPADDR PORTNUM|-f FILENAME}

Forward stdin/stdout to a file or network connection.

-4      Force IPv4
-6      Force IPv6
-L      Listen for multiple incoming connections (server mode)
-U      Use a UNIX domain socket
-W      SECONDS timeout for more data on an idle connection
-f      Use FILENAME (ala /dev/ttyS0) instead of network
-l      Listen for one incoming connection
-p      Local port number
-q      Quit SECONDS after EOF on stdin, even if stdout hasn't closed yet
-s      Local source address
-t      Allocate tty (must come before -l or -L)
-u      Use UDP
-w      SECONDS timeout to establish connection

Use "stty 115200 -F /dev/ttyS0 && stty raw -echo -ctlecho" with
netcat -f to connect to a serial port.

The command line after -l or -L is executed (as a child process) to handle
each incoming connection. If blank -l waits for a connection and forwards
it to stdin/stdout. If no -p specified, -l prints port it bound to and
backgrounds itself (returning immediately).

For a quick-and-dirty server, try something like:
netcat -s 127.0.0.1 -p 1234 -tL /bin/bash -l

@whitedavidp
Copy link
Author

Thanks. But my issue is that the -u option does not seem to work - even though it is documented. I ended up installing an additional busybox where it does work and I reference that one specifically.

@superbonaci
Copy link

Could I test if the -u works for me in some easy way?

@whitedavidp
Copy link
Author

Thanks but I am set now...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants