mirror of
https://github.com/boringproxy/boringproxy.git
synced 2025-02-25 18:55:29 -06:00
Override tunnel SSH server ports at runtime
This is a bit of a hack. Problem is if the server is restarted with a different SSH port, all the tunnels in the db have the incorrect port setting, so we're overriding at runtime. Really should update all the db entries but that's messy too. Probably the real solution is to decouple runtime tunnel settings from permanent tunnel settings, and only store the permanent ones in the db.
This commit is contained in:
parent
c0f884f049
commit
e09a7d91df
3
api.go
3
api.go
@ -64,6 +64,9 @@ func (a *Api) handleTunnels(w http.ResponseWriter, r *http.Request) {
|
|||||||
for k, tun := range tunnels {
|
for k, tun := range tunnels {
|
||||||
if tun.ClientName != clientName {
|
if tun.ClientName != clientName {
|
||||||
delete(tunnels, k)
|
delete(tunnels, k)
|
||||||
|
} else {
|
||||||
|
tun.ServerPort = a.config.SshServerPort
|
||||||
|
tunnels[k] = tun
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user