Skip to content

SSEServer srv was reset when execute 'Start' function? #156

@IsAmos01

Description

@IsAmos01

When the SSEServer instance was created using the NewSSEServer method, the http.server instance was passed in using the WithHTTPServer method, but when the sseserver.start method is executed, the http.server instance is reset

for instance:

sseServer := server.NewSSEServer(s, server.WithHTTPServer(&router))
if err := sseServer.Start(":8080"); err != nil {
fmt.Printf("Server error: %v\n", err)
}

but the srv is reset when execute Start function:

func (s *SSEServer) Start(addr string) error {
s.srv = &http.Server{
Addr: addr,
Handler: s,
}

return s.srv.ListenAndServe()

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions