add ability to filter routes based on headers
This commit is contained in:
@@ -79,21 +79,6 @@ func newNetwork(opts ...Option) Network {
|
||||
o(&options)
|
||||
}
|
||||
|
||||
// init tunnel address to the network bind address
|
||||
options.Tunnel.Init(
|
||||
tunnel.Address(options.Address),
|
||||
)
|
||||
|
||||
// init router Id to the network id
|
||||
options.Router.Init(
|
||||
router.Id(options.Id),
|
||||
)
|
||||
|
||||
// create tunnel client with tunnel transport
|
||||
tunTransport := tun.NewTransport(
|
||||
tun.WithTunnel(options.Tunnel),
|
||||
)
|
||||
|
||||
// set the address to a hashed address
|
||||
hasher := fnv.New64()
|
||||
hasher.Write([]byte(options.Address + options.Id))
|
||||
@@ -111,6 +96,22 @@ func newNetwork(opts ...Option) Network {
|
||||
peerAddress = address
|
||||
}
|
||||
|
||||
// init tunnel address to the network bind address
|
||||
options.Tunnel.Init(
|
||||
tunnel.Address(options.Address),
|
||||
)
|
||||
|
||||
// init router Id to the network id
|
||||
options.Router.Init(
|
||||
router.Id(options.Id),
|
||||
router.Address(peerAddress),
|
||||
)
|
||||
|
||||
// create tunnel client with tunnel transport
|
||||
tunTransport := tun.NewTransport(
|
||||
tun.WithTunnel(options.Tunnel),
|
||||
)
|
||||
|
||||
// server is network server
|
||||
server := server.NewServer(
|
||||
server.Id(options.Id),
|
||||
|
Reference in New Issue
Block a user