Repository navigation
Support Unix domain sockets in the local Mockttp server - #233
clivejefferies wants to merge 1 commit into
Conversation
|
This needs more thought I think. There's a lot of code in here (and probably in sub-dependencies) that assumes we have a TCP socket somewhere, and TCP address info available. We use the remote & local address and port for various things, like calculating client-relative addresses ( Tests are failing here because of an issue with latest Node on main, that's unrelated. That's already fixed on main, but you'll need to rebase to get this passing. You'll find the rebase also adds some challenges though, as #223 adds another new way we use TCP ports to control traffic, so that may need some handling too. |
Do you think there might be a simpler approach? |
Support Unix domain sockets in the local Mockttp server
Tools that embed Mockttp can already route traffic through a local relay.
Allowing the proxy to listen on a filesystem socket lets the relay reach it
using an app-owned directory and avoids opening a host TCP port. Our use case
is a debug-only Android emulator trace whose guest loopback relay carries
connections over ADB.
This adds a Node-only option to the existing local API.
The caller supplies an absolute path in an existing directory. The listener
rejects an occupied path and removes its socket on shutdown. The existing TCP
startup behavior is preserved. Unix mode rejects a TCP port argument and
reports a clear error if the caller requests the TCP-specific port or URL.
Verification
ownership, invalid options, and default TCP startup.
certificate and an upstream hostname mismatch each failed before HTTP reached
the origin.
relay and the compiled draft.