sse can‘t listene 0.0.0.0 #288
-
// WithBaseURL sets the base URL for the SSE server
func WithBaseURL(baseURL string) SSEOption {
return func(s *SSEServer) {
if baseURL != "" {
u, err := url.Parse(baseURL)
if err != nil {
return
}
if u.Scheme != "http" && u.Scheme != "https" {
return
}
// Check if the host is empty or only contains a port
if u.Host == "" || strings.HasPrefix(u.Host, ":") {
return
}
if len(u.Query()) > 0 {
return
}
}
s.baseURL = strings.TrimSuffix(baseURL, "/")
}
} In sse mode, why can't 0.0.0.0 be listened to, which makes it impossible to deploy on docker or k8s |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Sure, Just add "http://" at the beginning. |
Beta Was this translation helpful? Give feedback.
-
@stones-hub if you tried @uppercaveman's suggestion and it worked for you, please go ahead and close this issue. :) |
Beta Was this translation helpful? Give feedback.
-
Could you give an example? I hope the sse mode can support the cluster deployment of docker swarm. I have tried many times but failed |
Beta Was this translation helpful? Give feedback.
-
Set baseUrl to |
Beta Was this translation helpful? Give feedback.
-
I think that should resolve things for you @stones-hub. I'm going to convert this to a discussion, and we can continue from there. |
Beta Was this translation helpful? Give feedback.
Set baseUrl to
http://0.0.0.0
instead of just0.0.0.0