> For the complete documentation index, see [llms.txt](https://socket.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://socket.gitbook.io/docs/3-ke-hu-duan-apiclientapi/3.1-io/initialization_examples_with_multiplexing.md).

# 3.1.3 初始化示例-带多路复用

默认情况下，连接到不同命名空间时使用单个连接（以最小化资源）

```javascript
const socket= io();
const adminSocket =io('/admin')
//  将建立单一连接
```

使用`forceNew`选项可以禁用该行为：

```javascript
const socket= io();
const adminSocket= io('/admin',{forceNew:true})
// 将创建两个不同的连接
```
