Based on https://github.com/Jaxo/fxosstub.