In case anyone finds this in the future and is interested in a possible solution:
After a lot of digging around in the Bandit sources, then the Thousand Island sources, then the :file, :gen_tcp and :socket modules, I think there is no option to do this in Erlang and the BEAM without modifying the actual C bindings to the network stack…
But I did come up with a workaround for local development and written a long blog post about how to set everything up:
Or jump directly here for the actual solution:


















