mirror of
https://github.com/wso2/open-mcp-auth-proxy.git
synced 2025-06-28 01:23:30 +00:00
fix ListenPort
This commit is contained in:
parent
960261fc80
commit
a6d8eecdcc
3 changed files with 7 additions and 4 deletions
|
@ -49,14 +49,17 @@ func main() {
|
||||||
// 4. Build the main router
|
// 4. Build the main router
|
||||||
mux := proxy.NewRouter(cfg, provider)
|
mux := proxy.NewRouter(cfg, provider)
|
||||||
|
|
||||||
|
listen_address := fmt.Sprintf(":%d", cfg.ListenPort)
|
||||||
|
|
||||||
// 5. Start the server
|
// 5. Start the server
|
||||||
srv := &http.Server{
|
srv := &http.Server{
|
||||||
Addr: cfg.ListenAddress,
|
|
||||||
|
Addr: listen_address,
|
||||||
Handler: mux,
|
Handler: mux,
|
||||||
}
|
}
|
||||||
|
|
||||||
go func() {
|
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 {
|
if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
|
||||||
log.Fatalf("Server error: %v", err)
|
log.Fatalf("Server error: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
auth_server_base_url: ""
|
auth_server_base_url: ""
|
||||||
mcp_server_base_url: ""
|
mcp_server_base_url: ""
|
||||||
listen_address: ":8080"
|
listen_port: 8080
|
||||||
jwks_url: ""
|
jwks_url: ""
|
||||||
timeout_seconds: 10
|
timeout_seconds: 10
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ type CORSConfig struct {
|
||||||
type Config struct {
|
type Config struct {
|
||||||
AuthServerBaseURL string `yaml:"auth_server_base_url"`
|
AuthServerBaseURL string `yaml:"auth_server_base_url"`
|
||||||
MCPServerBaseURL string `yaml:"mcp_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"`
|
JWKSURL string `yaml:"jwks_url"`
|
||||||
TimeoutSeconds int `yaml:"timeout_seconds"`
|
TimeoutSeconds int `yaml:"timeout_seconds"`
|
||||||
MCPPaths []string `yaml:"mcp_paths"`
|
MCPPaths []string `yaml:"mcp_paths"`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue