1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-11-24 08:02:32 +02:00

Fix gateway addressing

- Set Gateway as node.ID when advertising
- Set server.Address as node.ID to listen on
- Set server.Advertise as node.Address
This commit is contained in:
Milos Gajdos 2019-09-17 16:11:02 +01:00
parent a811b4be3d
commit 21dc7bcccf
No known key found for this signature in database
GPG Key ID: 8B31058CC55DFD4F

View File

@ -87,7 +87,8 @@ func newNetwork(opts ...Option) Network {
// server is network server
server := server.NewServer(
server.Id(options.Id),
server.Address(options.Address),
server.Address(options.Id),
server.Advertise(options.Address),
server.Name(options.Name),
server.Transport(tunTransport),
)
@ -639,7 +640,7 @@ func (n *network) advertise(client transport.Client, advertChan <-chan *router.A
route := &pbRtr.Route{
Service: event.Route.Service,
Address: event.Route.Address,
Gateway: n.node.address,
Gateway: n.node.id,
Network: event.Route.Network,
Router: event.Route.Router,
Link: DefaultLink,