Skip to content

Commit

Permalink
getlantern/lantern#2306 Added full list of fallback proxies as chaine…
Browse files Browse the repository at this point in the history
…d servers
  • Loading branch information
oxtoacart committed Mar 14, 2015
1 parent a167b75 commit 1ad042c
Show file tree
Hide file tree
Showing 11 changed files with 2,227 additions and 821 deletions.
2 changes: 1 addition & 1 deletion src/github.com/getlantern/flashlight/client/balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (client *Client) initBalancer(cfg *ClientConfig) (*balancer.Balancer, front

log.Debugf("Adding %d chained servers", len(cfg.ChainedServers))
for _, s := range cfg.ChainedServers {
dialer, err := s.dialer()
dialer, err := s.Dialer()
if err == nil {
dialers = append(dialers, dialer)
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/github.com/getlantern/flashlight/client/chained.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type ChainedServerInfo struct {
QOS int
}

func (s *ChainedServerInfo) dialer() (*balancer.Dialer, error) {
func (s *ChainedServerInfo) Dialer() (*balancer.Dialer, error) {
log.Debug("Building dialer")

netd := &net.Dialer{
Expand Down
25 changes: 16 additions & 9 deletions src/github.com/getlantern/flashlight/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,22 @@ func (cfg *Config) applyClientDefaults() {
cfg.Client.FrontedServers = make([]*client.FrontedServerInfo, 0)
}
if len(cfg.Client.FrontedServers) == 0 && len(cfg.Client.ChainedServers) == 0 {
cfg.Client.FrontedServers = append(cfg.Client.FrontedServers, &client.FrontedServerInfo{
Host: "nl.fallbacks.getiantem.org",
Port: 443,
PoolSize: 30,
MasqueradeSet: cloudflare,
MaxMasquerades: 20,
QOS: 10,
Weight: 4000,
})
cfg.Client.FrontedServers = []*client.FrontedServerInfo{
&client.FrontedServerInfo{
Host: "nl.fallbacks.getiantem.org",
Port: 443,
PoolSize: 30,
MasqueradeSet: cloudflare,
MaxMasquerades: 20,
QOS: 10,
Weight: 4000,
},
}

cfg.Client.ChainedServers = make(map[string]*client.ChainedServerInfo, len(fallbacks))
for key, fb := range fallbacks {
cfg.Client.ChainedServers[key] = fb
}
}

// Make sure all servers have a QOS and Weight configured
Expand Down
608 changes: 608 additions & 0 deletions src/github.com/getlantern/flashlight/config/fallbacks.go

Large diffs are not rendered by default.

Loading

0 comments on commit 1ad042c

Please sign in to comment.