creates a client and runs against server
(token string, port int, testRTCServicePath testRTCServicePath, opts *testclient.Options)
| 285 | |
| 286 | // creates a client and runs against server |
| 287 | func createRTCClientWithToken(token string, port int, testRTCServicePath testRTCServicePath, opts *testclient.Options) *testclient.RTCClient { |
| 288 | if opts == nil { |
| 289 | opts = &testclient.Options{ |
| 290 | AutoSubscribe: true, |
| 291 | } |
| 292 | } |
| 293 | testRTCServicePathToTestClientOptions(testRTCServicePath, opts) |
| 294 | ws, err := testclient.NewWebSocketConn(fmt.Sprintf("ws://localhost:%d", port), token, opts) |
| 295 | if err != nil { |
| 296 | panic(err) |
| 297 | } |
| 298 | |
| 299 | c, err := testclient.NewRTCClient(ws, opts.UseJoinRequestQueryParam, opts) |
| 300 | if err != nil { |
| 301 | panic(err) |
| 302 | } |
| 303 | |
| 304 | go c.Run() |
| 305 | |
| 306 | return c |
| 307 | } |
| 308 | |
| 309 | func redisClient() *redis.Client { |
| 310 | return redis.NewClient(&redis.Options{ |