Hammerspoon / hammerspoon

Staggeringly powerful macOS desktop automation with Lua
http://www.hammerspoon.org
MIT License
12.11k stars 582 forks source link

hs.socket and hs.socket.udp listens on all interfaces #3634

Open cfal opened 6 months ago

cfal commented 6 months ago

neither TCP or UDP server sockets allow binding to a specific interface or address, eg https://github.com/Hammerspoon/hammerspoon/blob/master/extensions/socket/libsocket_udp.m#L209

it would be nice to support listening on a specific interface, eg communication on a bridge interface with a VM without exposing the server to the outside world.

cmsj commented 3 months ago

CocoaAsyncSocket supports binding to either interface or address, and I agree we should do this.