修改ip和端口

This commit is contained in:
2026-07-07 13:24:35 +08:00
parent 148b7dd167
commit ef00cf5a95
3 changed files with 14 additions and 14 deletions
+10 -10
View File
@@ -8,7 +8,7 @@
| 项目 | 值 |
|------|-----|
| 地址 | `http://61.164.252.86:13485` |
| 地址 | `http://192.140.180.73:8080` |
| 认证 | `X-API-Key` Header 或 `?key=` URL 参数 |
| 格式 | 所有返回均为 JSON |
@@ -19,7 +19,7 @@
```python
import requests
BRIDGE = "http://61.164.252.86:13485"
BRIDGE = "http://192.140.180.73:8080"
KEY = "your-api-key"
def api(path, params=None):
@@ -416,7 +416,7 @@ import pandas as pd
import time
from datetime import datetime
BRIDGE = "http://61.164.252.86:13485"
BRIDGE = "http://192.140.180.73:8080"
KEY = "your-api-key"
class Mt5Bridge:
@@ -553,9 +553,9 @@ if __name__ == "__main__":
在浏览器地址栏直接输入:
```
http://61.164.252.86:13485/health?key=your-api-key
http://61.164.252.86:13485/account?key=your-api-key
http://61.164.252.86:13485/symbols/XAUUSDc/tick?key=your-api-key
http://192.140.180.73:8080/health?key=your-api-key
http://192.140.180.73:8080/account?key=your-api-key
http://192.140.180.73:8080/symbols/XAUUSDc/tick?key=your-api-key
```
---
@@ -564,9 +564,9 @@ http://61.164.252.86:13485/symbols/XAUUSDc/tick?key=your-api-key
```powershell
$key = "your-api-key"
Invoke-RestMethod "http://61.164.252.86:13485/health?key=$key"
Invoke-RestMethod "http://61.164.252.86:13485/account?key=$key"
Invoke-RestMethod "http://61.164.252.86:13485/symbols/XAUUSDc/tick?key=$key"
Invoke-RestMethod "http://192.140.180.73:8080/health?key=$key"
Invoke-RestMethod "http://192.140.180.73:8080/account?key=$key"
Invoke-RestMethod "http://192.140.180.73:8080/symbols/XAUUSDc/tick?key=$key"
```
---
@@ -583,4 +583,4 @@ API Key 错误或没带。检查 Header 中的 `X-API-Key` 或 URL 中的 `?key=
保证金不足,减小手数或检查 `account.margin_free`
### 返回 "无法连接到远程服务器"
Bridge 未运行或网络不通,先检查 `/health`
Bridge 未运行或网络不通,先检查 `/health`
+3 -3
View File
@@ -157,7 +157,7 @@ Start-ScheduledTask -TaskName "Mt5Bridge"
| 字段 | 值 |
|------|-----|
| 类型 | TCP |
| 公网端口 | 13485 |
| 公网端口 | 8080 |
| 内网端口 | 8080 |
| 说明 | Mt5Bridge |
@@ -658,7 +658,7 @@ Stop-ScheduledTask -TaskName "Mt5Bridge"
## 十、安全建议
1. **API Key 必须修改**:部署前把默认的 `mt5bridge-2024-secret-key` 改成随机字符串
2. **端口号不要用默认的**:使用 13485-13489 范围内的随机端口
2. **端口号不要用默认的**当前使用 8080,如要更换建议用 10000 以上的随机端口
3. **防火墙白名单**:如果只有固定 IP 访问,在云服务商安全组里限制来源 IP
4. **不要用 HTTP 明文传输敏感数据**:可配合 Nginx Proxy Manager 加 HTTPS
5. **定期更换 API Key**:修改 `Program.cs` 中的 Key 后重新编译部署
5. **定期更换 API Key**:修改 `Program.cs` 中的 Key 后重新编译部署
+1 -1
View File
@@ -2,7 +2,7 @@ import requests
import time
import statistics
BRIDGE = "http://61.164.252.86:13485"
BRIDGE = "http://192.140.180.73:8080"
KEY = "UiHMqtaYLZzwBdcuS4RFmEGhgDO8N2eI"
HEADERS = {"X-API-Key": KEY}