mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 22:44:02 +03:00
Propagate DCOverrides
This commit is contained in:
+1
-5
@@ -302,11 +302,7 @@ func NewProxy(opts ProxyOpts) (*Proxy, error) {
|
||||
|
||||
logger := opts.getLogger("proxy")
|
||||
|
||||
tg, err := dc.New(
|
||||
logger.Named("telegram"),
|
||||
opts.getPreferIP(),
|
||||
map[int][]string{},
|
||||
) // TODO: propagate value
|
||||
tg, err := dc.New(logger.Named("telegram"), opts.getPreferIP(), opts.DCOverrides)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot build telegram dc fetcher: %w", err)
|
||||
}
|
||||
|
||||
@@ -113,6 +113,12 @@ type ProxyOpts struct {
|
||||
//
|
||||
// OBSOLETE and DEPRECATED. Ignored.
|
||||
UseTestDCs bool
|
||||
|
||||
// DCOverrides defines a set of IP addresses that should be used
|
||||
// with a higher priority to those that are calculated somehow by mtg.
|
||||
//
|
||||
// This is an optional setting
|
||||
DCOverrides map[int][]string
|
||||
}
|
||||
|
||||
func (p ProxyOpts) valid() error {
|
||||
|
||||
Reference in New Issue
Block a user