> ## Documentation Index
> Fetch the complete documentation index at: https://wukong.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 获取用户 IM 地址

> 获取用户的 IM 连接地址

## 概述

获取用户的 IM 连接地址，包括 TCP、WebSocket 和 WebSocket Secure 地址。

## 查询参数

<ParamField query="intranet" type="integer" default={0}>
  是否返回内网地址

  * `0` - 返回外网地址
  * `1` - 返回内网地址
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "http://localhost:5001/route?intranet=0"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('http://localhost:5001/route?intranet=0');
  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get('http://localhost:5001/route', params={'intranet': 0})
  data = response.json()
  print(data)
  ```

  ```go Go theme={null}
  package main

  import (
      "encoding/json"
      "fmt"
      "net/http"
  )

  func main() {
      resp, err := http.Get("http://localhost:5001/route?intranet=0")
      if err != nil {
          panic(err)
      }
      defer resp.Body.Close()
      
      var result map[string]interface{}
      json.NewDecoder(resp.Body).Decode(&result)
      fmt.Printf("%+v\n", result)
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 成功响应 theme={null}
  {
    "tcp_addr": "127.0.0.1:5100",
    "ws_addr": "ws://127.0.0.1:5200",
    "wss_addr": "wss://127.0.0.1:5300"
  }
  ```
</ResponseExample>

## 响应字段

<ResponseField name="tcp_addr" type="string" required>
  TCP 连接地址，格式为 `host:port`
</ResponseField>

<ResponseField name="ws_addr" type="string" required>
  WebSocket 连接地址，格式为 `ws://host:port`
</ResponseField>

<ResponseField name="wss_addr" type="string" required>
  WebSocket Secure 连接地址，格式为 `wss://host:port`
</ResponseField>

## 状态码

| 状态码 | 说明           |
| --- | ------------ |
| 200 | 成功获取 IM 连接地址 |
| 500 | 服务器内部错误      |
