added gateway support

A gateway can be specified in config.cfg within a [connection] section.

example configuration:

```
[connection]
gateway = hub.example.com
```