WebSocket 构造函数

WebSocket(
  1. String url,
  2. [Object? protocols]
)

实现

factory WebSocket(String url, [Object? protocols]) {
  if (protocols != null) {
    return WebSocket._create_1(url, protocols);
  }
  return WebSocket._create_2(url);
}