# 不同机子部署

{% hint style="info" %}
如果你的Go-cqhttp和服务端不在同一个机子上请按以下操作修改,请先完成部署再看本教程
{% endhint %}

## 注意

请确保Go-cqhttp所在的机子拥有公网IP并开放了2个以上端口

## 操作

### Go-cqhttp部分

打开Go-cqhttp的[Config.yml](/infinitebot-shi-yong-wen-dang/pei-zhi-wen-jian-gai-lan/go-cqhttp.md)(配置文件)修改`servers(通信方式)节点`

`请修改`Http和Websocket的`端口为你开放的端口` \
`注意俩个端口请不要相同`Http和Websocket`处于不同协议 但都为一个TCP(端口协议)写成一致端口会出现端口占用问题`

## 安全注意

* 默认的配置并没有任何防护,俩个端口如果被不怀好意的人拿到,可以通过这个操作机器人在群里发送消息/在服务器内发送消息 请注意防护 如果为一台机子请把0.0.0.0改为127.0.0.1使端口在本地

### 如何防护

* 在Go-cqhttp的[Config.yml](/infinitebot-shi-yong-wen-dang/pei-zhi-wen-jian-gai-lan/go-cqhttp.md)(配置文件)内的servers(通信方式)节点 \
  写入`default-middlewares.access-token` 字段。\
  并将该 token 设置到 InfinteBot3插件的`config.yml(配置文件)` 的 `connection.authorization` 字段，以对暴露在公网的 go-cqhttp 服务提供保护


---

# 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://infinitebot.gitbook.io/infinitebot-shi-yong-wen-dang/an-zhuang/bu-tong-ji-zi-bu-shu.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.
