Top
Best
New

Posted by rvermeulen98 12 hours ago

Show HN: Whosthere: A LAN discovery tool with a modern TUI, written in Go(github.com)
182 points | 66 commentspage 3
ryancnelson 6 hours ago||
is the only way to export the results "run in daemon mode and curl yourself"?
coolius 10 hours ago||
this is great! i had to tweak the config file on macos because it was using some weird interface (utun4) instead of en0. otherwise awesome tool, i am definitely going to be using this more often.
rvermeulen98 9 hours ago|
Thanks, I am glad you like it! I couldn't find a Go API that just returns the OS "default" network interface, so struggled a bit with a correct implementation for that part.

When reading some blog posts, I found often a solution where it sends out an UDP dial to for example 8.8.8.8:53 because you can then get the network interface back from the connection it's local address. As fallback I implemented to pick the first non-loopback interface that is up.

Would be open to suggestions to do this in a better way!

fellerts 9 hours ago||
I think this package does exactly what you need: https://pkg.go.dev/github.com/google/gopacket/routing. Works on my machine (error handling left to the reader)

    router, _ := routing.New()
    iface, _, _, _ := router.Route(net.ParseIP("8.8.8.8"))
    fmt.Println(iface.Name)
this prints my Ethernet interface as expected. It doesn't make any requests, it just figures out where to route a packet. I guess it interfaces with the OS routing table.
rvermeulen98 8 hours ago||
Thanks for sharing! This is definitely something I will look into, I am all in favor to simplify the current implementation of finding the "default" OS network interface.
contingencies 6 hours ago||
You'd better use the default route and not some random IP, particularly DNS IPs which people often meddle with.

  # IPv4 default route only
  uname
  Darwin$ route -n get 0.0.0.0 | grep interface | cut -d ':' -f2
  Linux$ route -nv  |grep ^0.0.0.0 | awk '{print $NF}'
sneak 6 hours ago||
Love it! I already have some ideas for additional improvements, might jump in and contribute a PR or two.

Great work.

hk1337 8 hours ago|
> Apple could not verify “whosthere” is free of malware that may harm your Mac or compromise your privacy.

Couldn't run it on macOS Tahoe. I believe this requires me lowering the security to allow it, which is something I would rather not doing.

rawgreaze 8 hours ago||
This is basically how every custom app works on Mac. You have to go to Settings -> Security & Privacy and click "Allow whosthere"
rvermeulen98 8 hours ago||
Would it help to get it on the "official" homebrew, instead of a custom tap/cask? Might try to do an application for that somewhere in the upcoming weeks.
phubbard 7 hours ago||
this can be fixed by

xattr -c `which whosthere`