Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/rdpgw/config/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ type Configuration struct {
type ServerConfig struct {
GatewayAddress string `koanf:"gatewayaddress"`
Port int `koanf:"port"`
BindAddress string `koanf:"bindaddress"`
CertFile string `koanf:"certfile"`
KeyFile string `koanf:"keyfile"`
Hosts []string `koanf:"hosts"`
Expand Down Expand Up @@ -215,6 +216,7 @@ func Load(configFile string) Configuration {
k.Load(confmap.Provider(map[string]interface{}{
"Server.Tls": "auto",
"Server.Port": 443,
"Server.BindAddress": "",
"Server.SessionStore": "cookie",
"Server.HostSelection": "roundrobin",
"Server.Authentication": "openid",
Expand Down
3 changes: 2 additions & 1 deletion cmd/rdpgw/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"crypto/tls"
"fmt"
"log"
"net"
"net/http"
"net/url"
"os"
Expand Down Expand Up @@ -326,7 +327,7 @@ func main() {

// setup server
server := http.Server{
Addr: ":" + strconv.Itoa(conf.Server.Port),
Addr: net.JoinHostPort(conf.Server.BindAddress, strconv.Itoa(conf.Server.Port)),
Handler: r,
TLSConfig: cfg,
TLSNextProto: make(map[string]func(*http.Server, *tls.Conn, http.Handler)), // disable http2
Expand Down
4 changes: 4 additions & 0 deletions dev/docker/rdpgw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Server:
KeyFile: /opt/rdpgw/key.pem
GatewayAddress: localhost:9443
Port: 9443
# BindAddress: "" # Binds to all interfaces (default)
# BindAddress: "127.0.0.1" # Localhost only (IPv4)
# BindAddress: "::1" # Localhost only (IPv6)
# BindAddress: "192.168.1.10" # Specific IP
Hosts:
- xrdp:3389
RoundRobin: false
Expand Down
Loading