Skip to content

Bind to Unix domain socket with a file descriptor #2119

Closed

Description

@xadenryan

I would like to be able to bind to a Unix domain socket with a file descriptor instead of binding the to host and port.

Looks like bun can do this: https://bun.com/docs/api/http#unix-domain-sockets

I think all we have to do is change the bun server binding to support the unix param.

My use case is for spinning up thousands of opencode instances in isolation so they can be tested in parallel without any shared state. I have a parser that parses out the message that prints the host and port that it currently binds to but this is flaky and I have to update it every time the text changes. It would be better if I can specify a file descriptor to the unix: param, then I don't have to go through the IP stack either.

Review of what needs to change in the Bun.serve call: https://opencode.ai/s/s7yqFUTh

Discord conversation: https://discord.com/channels/1391832426048651334/1394667004979445931/1407782275881631754

Activity

  1. rekram1-node commented on Dec 28, 2025

    @rekram1-node
    Collaborator

    [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

  2. BackSlasher commented on Jan 16, 2026

    @BackSlasher

    @rekram1-node could we reopen? I think this is valuable for sandboxed instances (running the server in a docker container, and the client outside it)

  3. prashanthpai commented on Jan 19, 2026

    @prashanthpai

    @xadenryan Please reopen

  4. rakibdev commented on Jan 19, 2026

    @rakibdev

    pls pls pls pls pls pls pls pls pls

  5. bobvanderlinden commented on Feb 27, 2026

    @bobvanderlinden

    I wrote a plugin to post state of opencode to a unix socket. See https://github.com/bobvanderlinden/nixos-config/blob/master/home/modules/opencode/session-status.js. It's to have a panel in my bottom bar to show the state of all opencode instances.

  6. divinity76 commented on Nov 10, 2026

    @divinity76

    Guess this is not exactly what you're asking for, but you may find

    #62743 feat(core): connect model providers over a Unix socket

    of interest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions