proxy: use wherever http.Client is, update mautrix
Added a new common.ConfigurableTransport interface which mediabrowser, ombi, jellyseer, discord, telegram and matrix (i.e. ThirdPartService/ContactMethodLinker) now all implement. proxies are bound to them in main.go, Email is still a special case (but from the previous commit, mailgun does use the proxy). mautrix/go has been updated, and context.TODO()s stuck everywhere since I still don't really comprehend why I should use them (FIXME literally).
This commit is contained in:
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -60,6 +61,11 @@ func newDiscordDaemon(app *appContext) (*DiscordDaemon, error) {
|
||||
return dd, nil
|
||||
}
|
||||
|
||||
// SetTransport sets the http.Transport to use for requests. Can be used to set a proxy.
|
||||
func (d *DiscordDaemon) SetTransport(t *http.Transport) {
|
||||
d.bot.Client.Transport = t
|
||||
}
|
||||
|
||||
// NewAuthToken generates an 8-character pin in the form "A1-2B-CD".
|
||||
func (d *DiscordDaemon) NewAuthToken() string {
|
||||
pin := genAuthToken()
|
||||
|
||||
Reference in New Issue
Block a user