improvements in the notification and connection

Added an option to notify after second failure only
Added the proxy configuration from https://github.com/mouldt