Firefox can talk to a unix socket. In your proxy settings specify the socket.
E.g., it is how you can more safely proxy through tor (which also can listen on a socket), with firefox running inside a network name space without access to a network interface. Things like webrtc cannot leak your real IP.