            {url:'https://plus.google.com', env:'HTTPS_PROXY'}
         ]
         Q.all todo.map (t) -> Q.Promise (rs) ->
-            session = require('electron').session
+            console.log "resolving proxy #{t.url}"
             session.defaultSession.resolveProxy t.url, (proxyURL) ->
+                console.log "resolved proxy #{proxyURL}"
                 # Format of proxyURL is either "DIRECT" or "PROXY 127.0.0.1:8888"
                 [_, purl] = proxyURL.split ' '
                 process.env[t.env] ?= if purl then "http://#{purl}" else ""

tmp       = require 'tmp'
clipboard = require('electron').clipboard
Menu      = require('electron').menu

tmp.setGracefulCleanup()


    mainWindow.on 'move',  (ev) -> ipcsend 'move', mainWindow.getPosition()

    # whenever it fails, we try again
    client.on 'connect_failed', (e) ->
        console.log 'connect_failed', e
        wait(3000).then -> reconnect()

    # when client requests (re-)init since the first init
