Skip to content

Commit

Permalink
fix: cdn AdvertiseIP not used
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Ma <[email protected]>
  • Loading branch information
jim3ma committed Nov 3, 2021
1 parent c001d4b commit 8cd4f3e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cdn/cdn.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

// Package cdnsystem cdn server
package cdn

import (
Expand Down Expand Up @@ -176,7 +175,11 @@ func (s *Server) Serve() error {
}

// Generate GRPC listener
lis, _, err := rpc.ListenWithPortRange(iputils.HostIP, s.config.ListenPort, s.config.ListenPort)
var listen = iputils.HostIP
if s.config.AdvertiseIP != "" {
listen = s.config.AdvertiseIP
}
lis, _, err := rpc.ListenWithPortRange(listen, s.config.ListenPort, s.config.ListenPort)
if err != nil {
logger.Fatalf("net listener failed to start: %+v", err)
}
Expand Down

0 comments on commit 8cd4f3e

Please sign in to comment.