[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

UNIX domain sockets

From: J.P.
Subject: UNIX domain sockets
Date: Sun, 08 Aug 2021 17:55:18 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Someone on Libera asked about this recently, so I thought I'd post an
example for posterity. This works when using socat or similar as a proxy
and also with local servers that support these sockets (like Ergo).

  (defun erc-open-af-unix (name buffer host _port &rest rest)
    (apply #'make-network-process
           `(:name ,name
             :buffer ,buffer
             :service ,host ; sorta makes sense, right?
             :family local

  (let ((erc-server-connect-function 'erc-open-af-unix))
    (erc-open "/tmp/my/sock"

Depending on your Emacs version and what patches you've got applied,
passing a non-integer port arg to `erc-open' may trigger a wrong type
error. FYI, this change set [1] allows specifying the socket file path
as the port (as well as nil for both that and the server).

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=48598

reply via email to

[Prev in Thread] Current Thread [Next in Thread]