Merge pull request #2375 from AudriusButkevicius/proxy

Add proxy support (fixes #271)
This commit is contained in:
Jakob Borg
2015-10-18 08:45:17 +02:00
21 changed files with 798 additions and 29 deletions

View File

@@ -30,6 +30,7 @@ import (
"github.com/syncthing/syncthing/lib/config"
"github.com/syncthing/syncthing/lib/connections"
"github.com/syncthing/syncthing/lib/db"
"github.com/syncthing/syncthing/lib/dialer"
"github.com/syncthing/syncthing/lib/discover"
"github.com/syncthing/syncthing/lib/events"
"github.com/syncthing/syncthing/lib/logger"
@@ -435,6 +436,8 @@ func upgradeViaRest() error {
r.Header.Set("X-API-Key", cfg.GUI().APIKey())
tr := &http.Transport{
Dial: dialer.Dial,
Proxy: http.ProxyFromEnvironment,
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
client := &http.Client{