diff --git a/apipb/legacy.go b/apipb/legacy.go index 7eb5fabf5..b37a2efdb 100644 --- a/apipb/legacy.go +++ b/apipb/legacy.go @@ -14,6 +14,7 @@ import ( "net" "strconv" "strings" + "time" commonconfig "github.com/getlantern/common/config" ) @@ -177,9 +178,15 @@ func ProxyToLegacyConfig(cfg *ProxyConnectConfig) (*commonconfig.ProxyConfig, er } case *ProxyConnectConfig_ConnectCfgWater: legacy.PluggableTransport = "water" + duration, err := time.ParseDuration(pCfg.ConnectCfgWater.DownloadTimeout.String()) + if err != nil { + duration = 5 * time.Minute + } legacy.PluggableTransportSettings = map[string]string{ - "water_wasm": base64.StdEncoding.EncodeToString(pCfg.ConnectCfgWater.Wasm), - "water_transport": pCfg.ConnectCfgWater.Transport, + "water_wasm": base64.StdEncoding.EncodeToString(pCfg.ConnectCfgWater.Wasm), + "water_transport": pCfg.ConnectCfgWater.Transport, + "wasm_available_at": strings.Join(pCfg.ConnectCfgWater.WasmAvailableAt, ","), + "download_timeout": duration.String(), } default: diff --git a/chained/water_impl.go b/chained/water_impl.go index 2f3b2498d..df7b8b5ae 100644 --- a/chained/water_impl.go +++ b/chained/water_impl.go @@ -48,7 +48,7 @@ var ( func newWaterImpl(dir, addr string, pc *config.ProxyConfig, reportDialCore reportDialCoreFn) (*waterImpl, error) { ctx := context.Background() - wasmAvailableAt := ptSetting(pc, "water_available_at") + wasmAvailableAt := ptSetting(pc, "wasm_available_at") transport := ptSetting(pc, "water_transport") d := &waterImpl{ raddr: addr,