Commit da8754d
authored
feat: add unix socket support (#66)
This PR also removes magic terminology since we no longer refer to the endpoint as a magic endpoint.
Unit tests have been added. For a manual smoke test:
`````markdown
### 1. Stand up a dummy Unix-socket “echo” server
This will listen on `/tmp/backend.sock` and echo back whatever you send it:
```bash
socat UNIX-LISTEN:/tmp/backend.sock,reuseaddr,fork EXEC:'/bin/cat'
```
Leave that running in Terminal A.
---
### 2. Run your new `listen-unix` side
Point it at the socket you just created:
```bash
dumbpipe listen-unix --socket-path /tmp/backend.sock
```
You’ll see something like:
```
Forwarding incoming requests to '/tmp/backend.sock'.
To connect, use e.g.:
dumbpipe connect-unix --socket-path /tmp/client.sock <NODE_TICKET>
```
Copy the `<NODE_TICKET>`.
---
### 3. Run your new `connect-unix` side
In Terminal C, do:
```bash
dumbpipe connect-unix --socket-path /tmp/client.sock <NODE_TICKET>
```
Now you’ve got a local socket at `/tmp/client.sock` that—behind the scenes—is piping straight through to your echo server.
---
### 4. Verify it works
In Terminal D, send a test string through the client socket and watch it come back:
```bash
echo "hello world" | socat - UNIX-CONNECT:/tmp/client.sock
# you should see: hello world
```
`````1 parent 89d3af6 commit da8754d
5 files changed
+1189
-676
lines changed
0 commit comments