(nodeID string, port uint32, configUpdater func(*config.Config))
| 195 | } |
| 196 | |
| 197 | func createMultiNodeServer(nodeID string, port uint32, configUpdater func(*config.Config)) *service.LivekitServer { |
| 198 | var err error |
| 199 | conf, err := config.NewConfig("", true, nil, nil) |
| 200 | if err != nil { |
| 201 | panic(fmt.Sprintf("could not create config: %v", err)) |
| 202 | } |
| 203 | conf.Port = port |
| 204 | conf.RTC.UDPPort = rtcconfig.PortRange{Start: int(port) + 1} |
| 205 | conf.RTC.TCPPort = port + 2 |
| 206 | conf.Redis.Address = "localhost:6379" |
| 207 | conf.Keys = map[string]string{testApiKey: testApiSecret} |
| 208 | conf.EnableDataTracks = true |
| 209 | if configUpdater != nil { |
| 210 | configUpdater(conf) |
| 211 | } |
| 212 | |
| 213 | currentNode, err := routing.NewLocalNode(conf) |
| 214 | if err != nil { |
| 215 | panic(err) |
| 216 | } |
| 217 | currentNode.SetNodeID(livekit.NodeID(nodeID)) |
| 218 | |
| 219 | // redis routing and store |
| 220 | s, err := service.InitializeServer(conf, currentNode) |
| 221 | if err != nil { |
| 222 | panic(fmt.Sprintf("could not create server: %v", err)) |
| 223 | } |
| 224 | |
| 225 | roomClient = livekit.NewRoomServiceJSONClient(fmt.Sprintf("http://localhost:%d", port), &http.Client{}) |
| 226 | return s |
| 227 | } |
| 228 | |
| 229 | type testRTCServicePath int |
| 230 |
no test coverage detected