mirror of
https://github.com/hrfee/jfa-go.git
synced 2026-01-18 16:47:42 +01:00
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:
@@ -4,6 +4,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
lm "github.com/hrfee/jfa-go/logmessages"
|
||||
)
|
||||
@@ -71,3 +72,8 @@ func GenericErr(status int, err error) error {
|
||||
return ErrUnknown{code: status}
|
||||
}
|
||||
}
|
||||
|
||||
type ConfigurableTransport interface {
|
||||
// SetTransport sets the http.Transport to use for requests. Can be used to set a proxy.
|
||||
SetTransport(t *http.Transport)
|
||||
}
|
||||
|
||||
@@ -4,4 +4,4 @@ replace github.com/hrfee/jfa-go/logmessages => ../logmessages
|
||||
|
||||
go 1.22.4
|
||||
|
||||
require github.com/hrfee/jfa-go/logmessages v0.0.0-20240805130902-86c37fb4237b
|
||||
require github.com/hrfee/jfa-go/logmessages v0.0.0-20240806200606-6308db495a0a
|
||||
|
||||
Reference in New Issue
Block a user