It turns out it was easier to just use the dht-rpc node module, which is a lower level module that hyperswarm is build on top of, than to use hyperswarm directly.
It was still very useful because it gave a working example of how to use the more basic dht, but I think that my goals and the goals of the developers of hyperswarm are too different in this case.