Use AdminDomain for ssh server address

This commit is contained in:
Anders Pitman committed 2020-10-02 17:07:24 -06:00
1 parent 8a37355bb6
commit be91ff62ef
2 files changed
+5 -4

No files matched your search

+4 -3
View File
@@ -9,6 +9,7 @@ import (
)
type Api struct {
config *BoringProxyConfig
auth *Auth
tunMan *TunnelManager
mux *http.ServeMux
@@ -23,9 +24,9 @@ type CreateTunnelResponse struct {
}
func NewApi(auth *Auth, tunMan *TunnelManager) *Api {
func NewApi(config *BoringProxyConfig, auth *Auth, tunMan *TunnelManager) *Api {
api := &Api{auth, tunMan, nil}
api := &Api{config, auth, tunMan, nil}
mux := http.NewServeMux()
@@ -69,7 +70,7 @@ func (a *Api) handleCreateTunnel(w http.ResponseWriter, r *http.Request) {
}
response := &CreateTunnelResponse{
ServerAddress: "anders.boringproxy.io",
ServerAddress: a.config.AdminDomain,
ServerPort: 22,
ServerPublicKey: "",
TunnelPort: port,
+1 -1
View File
@@ -73,7 +73,7 @@ func NewBoringProxy() *BoringProxy {
p.handleAdminRequest(w, r)
})
api := NewApi(auth, tunMan)
api := NewApi(config, auth, tunMan)
http.Handle("/api/", http.StripPrefix("/api", api))
go http.Serve(adminListener, nil)