Skip to content

Instantly share code, notes, and snippets.

@zinozzino
Created January 21, 2016 18:41
Show Gist options
  • Save zinozzino/e26446fe90bf5c0650f0 to your computer and use it in GitHub Desktop.
Save zinozzino/e26446fe90bf5c0650f0 to your computer and use it in GitHub Desktop.
If you want to use UNIX domain socket instead of a TCP socket in MPD Widget (copycat-killers/lain)
--[[ Before
mpdh = "telnet://" .. host .. ":" .. port
async.request(echo .. " | curl --connect-timeout 1 -fsm 3 " .. mpdh, function (f)
--]]
--[[ After
mpdh = "~/.config/mpd/socket"
async.request(echo .. " | ncat -U " .. mpdh, function (f)
-- or you can use `socat` version
mpdh = "~/.config/mpd/socket"
async.request(echo .. " | socat - UNIX-CONNECT:" .. mpdh, function (f)
--]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment