fix ListenPort

This commit is contained in:
Thilina Shashimal Senarath 2025-04-03 09:32:36 +05:30
parent 960261fc80
commit a6d8eecdcc
3 changed files with 7 additions and 4 deletions

View file

@ -49,14 +49,17 @@ func main() {
// 4. Build the main router
mux := proxy.NewRouter(cfg, provider)
listen_address := fmt.Sprintf(":%d", cfg.ListenPort)
// 5. Start the server
srv := &http.Server{
Addr: cfg.ListenAddress,
Addr: listen_address,
Handler: mux,
}
go func() {
log.Printf("Server listening on %s", cfg.ListenAddress)
log.Printf("Server listening on %s", listen_address)
if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
log.Fatalf("Server error: %v", err)
}

View file

@ -2,7 +2,7 @@
auth_server_base_url: ""
mcp_server_base_url: ""
listen_address: ":8080"
listen_port: 8080
jwks_url: ""
timeout_seconds: 10

View file

@ -29,7 +29,7 @@ type CORSConfig struct {
type Config struct {
AuthServerBaseURL string `yaml:"auth_server_base_url"`
MCPServerBaseURL string `yaml:"mcp_server_base_url"`
ListenAddress string `yaml:"listen_address"`
ListenPort int `yaml:"listen_port"`
JWKSURL string `yaml:"jwks_url"`
TimeoutSeconds int `yaml:"timeout_seconds"`
MCPPaths []string `yaml:"mcp_paths"`