mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 05:12:46 +00:00
Use default transport for AS traffic (#1789)
* Use default transport for AS traffic * Update gmsl and use default client * Remove replace * Fix go.sum * Update gomatrixserverlib * Go back to appservices managing their own HTTP clients because argh * Add missing context
This commit is contained in:
parent
fe021d3742
commit
6aa262ead8
5 changed files with 19 additions and 27 deletions
|
@ -290,22 +290,6 @@ func (b *BaseDendrite) CreateClient() *gomatrixserverlib.Client {
|
|||
return client
|
||||
}
|
||||
|
||||
// CreateAppserviceClient creates a new client for application services.
|
||||
// It has a specific timeout and obeys TLS validation from the appservice
|
||||
// config rather than the federation config.
|
||||
func (b *BaseDendrite) CreateAppserviceClient() *gomatrixserverlib.Client {
|
||||
opts := []gomatrixserverlib.ClientOption{
|
||||
gomatrixserverlib.WithSkipVerify(b.Cfg.AppServiceAPI.DisableTLSValidation),
|
||||
gomatrixserverlib.WithTimeout(time.Second * 60),
|
||||
}
|
||||
if b.Cfg.Global.DNSCache.Enabled {
|
||||
opts = append(opts, gomatrixserverlib.WithDNSCache(b.DNSCache))
|
||||
}
|
||||
client := gomatrixserverlib.NewClient(opts...)
|
||||
client.SetUserAgent(fmt.Sprintf("Dendrite/%s", internal.VersionString()))
|
||||
return client
|
||||
}
|
||||
|
||||
// CreateFederationClient creates a new federation client. Should only be called
|
||||
// once per component.
|
||||
func (b *BaseDendrite) CreateFederationClient() *gomatrixserverlib.FederationClient {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue