mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-04 06:53:12 +00:00
Fix announced addresses (#710)
This commit is contained in:
parent
e9bc91f4e0
commit
e16dcef9ee
@ -243,6 +243,12 @@ when isMainModule:
|
|||||||
(nodev2ExtIp, nodev2ExtPort, _) = setupNat(conf.nat, clientId,
|
(nodev2ExtIp, nodev2ExtPort, _) = setupNat(conf.nat, clientId,
|
||||||
Port(uint16(conf.libp2pTcpPort) + conf.portsShift),
|
Port(uint16(conf.libp2pTcpPort) + conf.portsShift),
|
||||||
Port(uint16(conf.udpPort) + conf.portsShift))
|
Port(uint16(conf.udpPort) + conf.portsShift))
|
||||||
|
## The following heuristic assumes that, in absence of manual
|
||||||
|
## config, the external port is the same as the bind port.
|
||||||
|
extPort = if nodev2ExtIp.isSome() and nodev2ExtPort.isNone():
|
||||||
|
some(Port(uint16(conf.libp2pTcpPort) + conf.portsShift))
|
||||||
|
else:
|
||||||
|
nodev2ExtPort
|
||||||
|
|
||||||
let
|
let
|
||||||
bridge = Chat2Matterbridge.new(
|
bridge = Chat2Matterbridge.new(
|
||||||
@ -250,7 +256,7 @@ when isMainModule:
|
|||||||
mbGateway = conf.mbGateway,
|
mbGateway = conf.mbGateway,
|
||||||
nodev2Key = conf.nodekey,
|
nodev2Key = conf.nodekey,
|
||||||
nodev2BindIp = conf.listenAddress, nodev2BindPort = Port(uint16(conf.libp2pTcpPort) + conf.portsShift),
|
nodev2BindIp = conf.listenAddress, nodev2BindPort = Port(uint16(conf.libp2pTcpPort) + conf.portsShift),
|
||||||
nodev2ExtIp = nodev2ExtIp, nodev2ExtPort = nodev2ExtPort,
|
nodev2ExtIp = nodev2ExtIp, nodev2ExtPort = extPort,
|
||||||
contentTopic = conf.contentTopic)
|
contentTopic = conf.contentTopic)
|
||||||
|
|
||||||
waitFor bridge.start()
|
waitFor bridge.start()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user