Skip to content

Allow connection to AF_UNIX socket nREPL servers #417

@chancerussell

Description

@chancerussell

nREPL has had support for running servers through AF_UNIX-style domain sockets for a while: nrepl/nrepl#270 . It'd be nice if we could connect to those servers with vim-fireplace.

I've messed around and have confirmed that vim-fireplace can talk to nREPL over a domain socket with minimal changes to the Connection class's socket method in pythonx/fireplace.py to instantiate the correct type of socket as appropriate. I’m less sure of how starting such a connection should work.

The main question I have is: how should the user indicate that they wish to connect to a domain socket server?

Options I can think of:

  • Smarten up FireplaceConnect to recognize connection strings that represent filesystem locations. This might be problematic because of ambiguous cases where a given string could represent either a hostname or a filesystem location.
  • Add a new function analogous to FireplaceConnect specifically for connecting to domain sockets. This is a little less convenient but removes the ambiguity.
  • Punt and require users to pass in an unambiguous “I want a domain socket connection” string to FireplaceConnect. When nREPL starts up in socket mode, it prints a message like nREPL server started on socket nrepl+unix:$SOCKET_PATH, so maybe treating nrepl+unix: as a magic prefix would suffice.

I’ve opened #416 as a draft proof of concept. It works, but it isn’t pretty.

Thanks for all your work on vim-fireplace!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions