Open
Description
So, my problem is: I have a quite complex build step for my app that is run before running the server with all the goodies and db connections, but still loads some components. So, in order to integrate the primus client in my browserify bundle I have the following options:
- Spin up the whole server and initialize primus like normal to get primus.library(): simple, yet naive because inefficient and not always possible
- Create a http server, but don't bind it to a port and set a request handler unless we're in "run" mode: clever, but delaying the binding of the request handler is apparently too clever (It would have been nice to have known about this hack before having to dig through the code, as a side note)
- Initialize primus twice, the first time with a dummy server and if in run mode the second time after binding the actual http server
I'd consider all three options to be hacks. A real solution would be to be able to call primus.initialize myself (in case no server option was given). I'm not sure that woud work, though, because transformers need to register and stuff, but I thought I'd get this out there so you guys can check if it's feasible.