> For the complete documentation index, see [llms.txt](https://marcosteam.gitbook.io/sspanel-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://marcosteam.gitbook.io/sspanel-api/yong-hu-she-zhi/lian-jie-she-zhi.md).

# 连接设置

以下 API 可以修改用户的连接设置。

## method

<mark style="color:green;">`POST`</mark> `/user/method`

修改用户的加密方式，include cookie。

#### Path Parameters

| Name   | Type   | Description |
| ------ | ------ | ----------- |
| method | string | 用户希望设置的加密方式 |

{% tabs %}
{% tab title="200 ret：修改是否成功
msg：回显消息" %}

```
{"ret":1,"msg":"..."}
```

{% endtab %}
{% endtabs %}

## ssr

<mark style="color:green;">`POST`</mark> `/user/ssr`

&#x20;修改用户的连接协议、混淆方式等（仅 SSR 生效）。

#### Request Body

| Name        | Type   | Description |
| ----------- | ------ | ----------- |
| protocol    | string | SSR 连接协议    |
| obfs        | string | SSR 混淆方式    |
| obfs\_param | string | SSR 混淆参数    |

{% tabs %}
{% tab title="200 ret：修改是否成功
msg：回显消息" %}

```
{"ret":1,"msg":"..."}
```

{% endtab %}
{% endtabs %}

以下为节点转发设置相关 API ：

## relay

<mark style="color:green;">`POST`</mark> `/user/relay`

&#x20;设置节点中转规则，include cookie。

#### Request Body

| Name         | Type   | Description     |
| ------------ | ------ | --------------- |
| source\_node | number | 起始节点 ID         |
| dist\_node   | number | 目标节点 ID         |
| port         | number | 端口号             |
| priority     | number | 转发优先级，数字越低优先级越高 |

{% tabs %}
{% tab title="200 " %}

```
{"ret":1,"msg":"\u6dfb\u52a0\u6210\u529f"}
```

{% endtab %}
{% endtabs %}

## relay\_edit

<mark style="color:green;">`POST`</mark> `/user/relay/:id`

编辑转发规则，include cookie，参数同 relay 。

#### Request Body

| Name         | Type   | Description     |
| ------------ | ------ | --------------- |
| source\_node | number | 起始节点 ID         |
| dist\_node   | number | 目标节点 ID         |
| port         | number | 端口号             |
| priority     | number | 转发优先级，数字越低优先级越高 |

{% tabs %}
{% tab title="200 " %}

```
{"ret":1,"msg":"\u4fee\u6539\u6210\u529f"}
```

{% endtab %}
{% endtabs %}

## relay\_delete

<mark style="color:red;">`DELETE`</mark> `/user/relay`

&#x20;删除指定的中转规则。

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| id   | number | 欲删除的中转规则 ID |

{% tabs %}
{% tab title="200 " %}

```
{"ret":1,"msg":"\u5220\u9664\u6210\u529f"}
```

{% endtab %}
{% endtabs %}
