Skip to content

Support for socketPath (unix domain sockets) for requests. #126

Description

@mctrafik

Hi. I'd like to fetch something from a socket instead of a TCP/IP host:port.

So if I start the server like:

import { createServer } from 'node:http2';
const server = createServer();
// ...define services.
server.listen('/tmp/test.sock');

I'd like to be able to fetch from it.

The native node fetch allows this through a custom agent, i.e.:

fetch('http://anything/my/path', { dispatcher: new Agent({ socketPath: '/tmp/test.sock'})});

but there's not an equivalent in fetch-h2.

Can this be added?

Thank you.

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