Example #1
0
// Create TestConfig to the test using the functions created in the meshnet library.
func createTestConfig2(port int) TestConfig {
	testConfig := TestConfig{}
	testConfig.NodeConfig = nodemanager.NewNodeConfig()
	testConfig.TransportConfig = transport.CreateTransportConfig(testConfig.NodeConfig.PubKey)
	testConfig.UDPConfig = physical.CreateUdp(port, "127.0.0.1")

	return testConfig
}
Example #2
0
// Create TestConfig to the test using the functions created in the meshnet library.
func CreateConfig(address string, port int) *TestConfig {
	testConfig := &TestConfig{}
	testConfig.ExternalAddress = address
	testConfig.StartPort = port
	testConfig.Port = port
	testConfig.NodeConfig = NewNodeConfig()
	testConfig.TransportConfig = transport.CreateTransportConfig(testConfig.NodeConfig.PubKey)
	testConfig.PeerToPeers = map[string]*Peer{}

	return testConfig
}