added gateway support

A gateway can be specified in config.cfg within a [connection] section.

example:

[connection]
gateway = hub.example.com