feat: switch to proxy when need be

This commit is contained in:
James Houlahan
2020-04-01 17:20:03 +02:00
parent f239e8f3bf
commit ce29d4d74e
36 changed files with 311 additions and 320 deletions

View File

@ -274,8 +274,11 @@ func run(context *cli.Context) (contextError error) { // nolint[funlen]
log.Error("Could not get credentials store: ", credentialsError)
}
clientman := pmapi.NewClientManager(pmapifactory.GetClientConfig(cfg, eventListener))
bridgeInstance := bridge.New(cfg, pref, panicHandler, eventListener, Version, clientman, credentialsStore)
clientConfig := pmapifactory.GetClientConfig(cfg.GetAPIConfig())
cm := pmapi.NewClientManager(clientConfig)
pmapifactory.SetClientRoundTripper(cm, clientConfig, eventListener)
bridgeInstance := bridge.New(cfg, pref, panicHandler, eventListener, Version, cm, credentialsStore)
imapBackend := imap.NewIMAPBackend(panicHandler, eventListener, cfg, bridgeInstance)
smtpBackend := smtp.NewSMTPBackend(panicHandler, eventListener, pref, bridgeInstance)