Note
Womacks’s pip requirements files are split into a base file (requirements.txt) and a server file (requirements-server.txt). To run the server, you must install requirements-server.txt, which includes the extra requirements needed by the server. The make server command will do this, or pip install -r requirements-server.txt.
In the simplest case – you want to use Womack to push events to clients, and don’t need to customize anything – you can just run the womack script. It accepts a number of command-line arguments.
The hostname or ip to serve on. Default: 0.0.0.0
The port to bind to. Default: 8111
The host where redis is running. Default: localhost
The port where redis is running. Default: 6379
Output debugging information to the console. Default: False
See Womack namespace for information about customizing Womack’s handling of socketio namespaces. You can use a namespace to customize how messages are passed in your Womack-using system.
If besides (or instead of) that you want to customize how the server is run (for instance, to turn on the flash policy server, which is off by default, or to daemonize the server), you have to deal with a few phases of execution:
You can use womack.server.parse_argv() to parse command line options – if you want to use the same ones – or parse them yourself and call womack.config.config.configure() to configure the Womack server.
Womack is based on bottle and uses the standard socketio.SocketIOServer to serve the bottle application that is configured in womack.server:
def main(argv=None):
"""Parse command-line arguments and start the server"""
opts = parse_argv(argv)
if opts.debug:
from dozer import Dozer
You can do the same thing, just pass womack.server.app to a SocketIOServer in the configuration of your choice, and run it.