Skip to content

Commit

Permalink
Local publisher server listen on all interfaces
Browse files Browse the repository at this point in the history
Now the server for the local publisher will listen on all interfaces,
but the publisher itself will advertise on the configured address.
  • Loading branch information
rossjones committed Mar 20, 2024
1 parent a89cb64 commit 485cf14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/publisher/local/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func NewLocalPublisher(ctx context.Context, directory string, host string, port
urlPrefix: fmt.Sprintf("http://%s:%d", host, port),
}

p.server = NewLocalPublisherServer(ctx, p.baseDirectory, p.host, p.port)
p.server = NewLocalPublisherServer(ctx, p.baseDirectory, p.port)
go p.server.Run(ctx)

return p
Expand Down
5 changes: 3 additions & 2 deletions pkg/publisher/local/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ type LocalPublisherServer struct {
const (
readHeaderTimeout = 3 * time.Second
readTimeout = 3 * time.Second
allAddresses = "0.0.0.0"
)

func NewLocalPublisherServer(ctx context.Context, directory, address string, port int) *LocalPublisherServer {
func NewLocalPublisherServer(ctx context.Context, directory string, port int) *LocalPublisherServer {
return &LocalPublisherServer{
rootDirectory: directory,
address: address,
address: allAddresses, // we listen on all addresses
port: port,
}
}
Expand Down

0 comments on commit 485cf14

Please sign in to comment.