> 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.3-socket/socket_handshake.md).

# 4.3.6 socket\_handshake

* (Object)

握手细节：

```javascript
{
    "headers": "",//作为握手的一部分发送的头
    "time":"",//创建日期（字符串）
    "address":"",//客户端的IP
    "xdomian":"",//连接是否跨域
    "secure":"",//连接是否安全
    "issued":"",//创建日期（作为Unix时间戳）
    "url":"",//请求URL字符串
    "query":""//查询的对象
}
```

使用：

```javascript
io.use((socket,next)=>{
    let handshake= socket.handshake;
})

io.on('connection',(socket)=>{
    let handshake= socket.handshake;
})
```
