Ok here is my idea:
Mock server: Has a factory function which fork()s and then creates a simple socket server on specified port and initializes a pipe and returns information about that pipe
Mock client: Ensures a server is started, gets pipe info and uses that to communicate with the server. When setting up a mocj URL client pushes info through the pipe and the server sets up a coresponding route