Support for proxy servers

Added optional proxy parameter to constructors.