Echoo文档中心Echoo文档中心
Home
Echoo HTTP API
Home
Echoo HTTP API
  • 租赁服-启动本地代理服务器 /api/rental/run_local

租赁服-启动本地代理服务器 /api/rental/run_local

您可以使用这个API启动代理服务器

返回API列表

请求地址

POST /api/run_local

请求头

无

请求参数

调用类型:POST form-data

  • user_id 登录返回的userid
  • server_id 服务器ID
  • player_name 玩家名
  • port 本地服务器端口
  • host_server 租赁服服务器IP,通过enter接口获取
  • port_server 租赁服服务器端口,通过enter接口获取
  • sock5_ip Sock5代理服务器信息(IP:端口)
  • sock5_auth Sock5代理服务器验证(username:password)

注意,sock5_ip和sock5_auth写空为不启用代理

调用返回

返回类型:Json

返回示例:

{"code": 0, "message": "successful"}

参数解释:

  • code——只有code为0时代表请求成功,如果请求失败错误原因会显示在message里
  • message——错误信息或成功信息

示例代码

Python:

import requests
from requests_toolbelt import MultipartEncoder

url = 'http://127.0.0.1:21000/api/rental/run_local'

m = MultipartEncoder(
    fields={
        'user_id': ('', '用户ID'),
        'server_id': ('', '服务器ID'),
        'player_name': ('', '玩家名'),
        'port': ('', '本地服务器端口'),
        'host_server': ('', '租赁服服务器IP'),
        'port_server': ('', '租赁服服务器端口'),
        'sock5_ip': ('', 'Sock5代理IP:端口'),
        'sock5_auth': ('', 'Sock5用户名:密码')
    }
)

headers = {
    'Content-Type': m.content_type
}

response = requests.post(url, data=m, headers=headers)

print(response.status_code)
print(response.text)
最近更新:: 2025/11/23 19:14