> 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/4-fu-wu-duan-apiserverapi/4.2-ming-ming-kong-jian-namespace/event_connect.md).

# 4.2.10 连接事件 event\_connect

* `socket` (Socket) 与 客户端的socket 连接

在来自客户端的连接上触发。

```javascript
io.on('connect',socket=>{
    // ...
})

io.of('/admin').on('connect',socket=>{
    // ... 
})
```
