Hammerspoon / hammerspoon

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

[Feature] Add support for unix domain (file) sockets #2657

Open asmagill opened 3 years ago

asmagill commented 3 years ago

Adding to issues as a reminder. Probably as hs.socket.unix since hs.socket already exists and handles TCP sockets. Unless a better suggestion comes along...

cmsj commented 3 years ago

I was just checking out CocoaAsyncSocket (which obviously we use for TCP/UDP sockets) to see if it supports UNIX sockets and... it does!

Then I went to look at the differences between our TCP and UDP implementations to see if we could unify them and UNIX sockets with a single implementation and I accidentally read the docstrings for http://www.hammerspoon.org/docs/hs.socket.html#connect and..... we support UNIX sockets already apparently!

asmagill commented 3 years ago

Yeah, as I mentioned in #2637 the documentation mentions it in the functions/methods, but not at the top... I didn't get a chance to test it last night, but if you can, or I will hopefully tonight/tomorrow, then the request should change to an update to make it more clear in the header of the documentation.