I think 10 seconds would be a good default because when the webserver doesn’t reply within 10 seconds there’s probably a problem anyway. But if you have this as a parameter it shouldn’t be a problem anyway.
For desktop I would recommend using wget or curl right now as they deal with all the proxy/https etc BS that a raw socket implementation can’t (and I wont be attempting to build libcurl (again) any time soon).
See src/ted2go/product/ModuleManager.monkey2 for an example, esp. DownloadModules() function.
There is no ETA for an emsctipten WGET yet, although there is a ‘fetch’ API that could theoretically do the trick if anyone’s interested in mx2-ifying it.