Skip to content

Commit 7c3486f

Browse files
committed
Propagate the new addRoute API to SNI and HTTP host
1 parent f89ab2b commit 7c3486f

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

http.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ func (p *Proxy) AddHTTPHostRoute(ipPort, httpHost string, dest Target) {
3737
// for any additional routes on ipPort.
3838
//
3939
// The ipPort is any valid net.Listen TCP address.
40-
func (p *Proxy) AddHTTPHostMatchRoute(ipPort string, match Matcher, dest Target) {
41-
p.addRoute(ipPort, httpHostMatch{match, dest})
40+
func (p *Proxy) AddHTTPHostMatchRoute(ipPort string, match Matcher, dest Target) (routeId int) {
41+
return p.addRoute(ipPort, httpHostMatch{match, dest})
4242
}
4343

4444
type httpHostMatch struct {

sni.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ import (
3434
// with AddStopACMESearch.
3535
//
3636
// The ipPort is any valid net.Listen TCP address.
37-
func (p *Proxy) AddSNIRoute(ipPort, sni string, dest Target) {
38-
p.AddSNIMatchRoute(ipPort, equals(sni), dest)
37+
func (p *Proxy) AddSNIRoute(ipPort, sni string, dest Target) (routeId int) {
38+
return p.AddSNIMatchRoute(ipPort, equals(sni), dest)
3939
}
4040

4141
// AddSNIMatchRoute appends a route to the ipPort listener that routes
@@ -48,16 +48,15 @@ func (p *Proxy) AddSNIRoute(ipPort, sni string, dest Target) {
4848
// with AddStopACMESearch.
4949
//
5050
// The ipPort is any valid net.Listen TCP address.
51-
func (p *Proxy) AddSNIMatchRoute(ipPort string, matcher Matcher, dest Target) {
51+
func (p *Proxy) AddSNIMatchRoute(ipPort string, matcher Matcher, dest Target) (routeId int) {
5252
cfg := p.configFor(ipPort)
5353
if !cfg.stopACME {
5454
if len(cfg.acmeTargets) == 0 {
5555
p.addRoute(ipPort, &acmeMatch{cfg})
5656
}
5757
cfg.acmeTargets = append(cfg.acmeTargets, dest)
5858
}
59-
60-
p.addRoute(ipPort, sniMatch{matcher, dest})
59+
return p.addRoute(ipPort, sniMatch{matcher, dest})
6160
}
6261

6362
// AddStopACMESearch prevents ACME probing of subsequent SNI routes.

0 commit comments

Comments
 (0)