# 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;
})
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://socket.gitbook.io/docs/4-fu-wu-duan-apiserverapi/4.3-socket/socket_handshake.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
