|
|
@@ -30,7 +30,7 @@ type Proxy struct {
|
|
30
|
30
|
idleTimeout time.Duration
|
|
31
|
31
|
handshakeTimeout time.Duration
|
|
32
|
32
|
domainFrontingPort int
|
|
33
|
|
- domainFrontingIP string
|
|
|
33
|
+ domainFrontingHost string
|
|
34
|
34
|
domainFrontingProxyProtocol bool
|
|
35
|
35
|
workerPool *ants.PoolWithFunc
|
|
36
|
36
|
telegram *dc.Telegram
|
|
|
@@ -48,11 +48,12 @@ type Proxy struct {
|
|
48
|
48
|
}
|
|
49
|
49
|
|
|
50
|
50
|
// DomainFrontingAddress returns a host:port pair for a fronting domain.
|
|
51
|
|
-// If DomainFrontingIP is set, it is used instead of resolving the hostname.
|
|
|
51
|
+// If a fronting host (literal IP or hostname) is configured, it is used
|
|
|
52
|
+// instead of resolving the secret's hostname.
|
|
52
|
53
|
func (p *Proxy) DomainFrontingAddress() string {
|
|
53
|
54
|
host := p.secret.Host
|
|
54
|
|
- if p.domainFrontingIP != "" {
|
|
55
|
|
- host = p.domainFrontingIP
|
|
|
55
|
+ if p.domainFrontingHost != "" {
|
|
|
56
|
+ host = p.domainFrontingHost
|
|
56
|
57
|
}
|
|
57
|
58
|
|
|
58
|
59
|
return net.JoinHostPort(host, strconv.Itoa(p.domainFrontingPort))
|
|
|
@@ -354,7 +355,7 @@ func NewProxy(opts ProxyOpts) (*Proxy, error) {
|
|
354
|
355
|
eventStream: opts.EventStream,
|
|
355
|
356
|
logger: logger,
|
|
356
|
357
|
domainFrontingPort: opts.getDomainFrontingPort(),
|
|
357
|
|
- domainFrontingIP: opts.DomainFrontingIP,
|
|
|
358
|
+ domainFrontingHost: opts.DomainFrontingIP,
|
|
358
|
359
|
tolerateTimeSkewness: opts.getTolerateTimeSkewness(),
|
|
359
|
360
|
idleTimeout: opts.getIdleTimeout(),
|
|
360
|
361
|
handshakeTimeout: opts.getHandshakeTimeout(),
|