# 2323 **Repository Path**: edgeros/ccc ## Basic Information - **Project Name**: 2323 - **Description**: 提供基础的 vsoa 接口示例以及基础的 Docker 镜像构建模板 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2025-06-26 - **Last Updated**: 2025-11-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # VSOA Service 开发模板(Linux Docker) 此模板提供基础的 VSOA 接口示例以及 Docker 镜像构建模板 ## VSOA Server API ### RPC 请求 > GET /echo 回声测试接口,该接口原样输出请求的 `payload.param` 内容,并向客户端返回原样内容 > GET /health 健康检查接口,用于 ecsm 平台判断 VSOA 服务是否运行正常 ### 消息订阅发布 > /count 计数器消息,该接口可监听 VSOA 服务通过 publish 上报的消息 ## 默认配置 - Position 服务默认监听端口: 1118 - VSOA 示例服务默认监听端口: 1119 - VSOA 示例服务名 `demo` ## 以 Node.js 运行 ``` sh git clone https://gitee.com/edgeros/vsoa-demo-nodejs.git cd vsoa-demo-nodejs # 安装依赖软件包 npm install # 启动服务器程序 node server.js # 启动客户端程序 node client.js ``` ## 以 Docker 运行 ### 构建镜像 ``` sh git clone https://gitee.com/edgeros/vsoa-demo-nodejs.git cd vsoa-demo-nodejs npm install npm run build ``` ### 启动容器 > docker run --net=host -it vsoa-demo:latest [server|client] [address|url] ``` sh # 启动 VSOA 服务器程序 docker run --net=host -it vsoa-demo:latest server # 启动 VSOA 客户端 (默认连接: 127.0.0.1:1119) docker run --net=host -it vsoa-demo:latest client # 启动 VSOA 客户端 指定 VSOA 服务地址 docker run --net=host -it vsoa-demo:latest client 127.0.0.1:1119 # 或者通过环境变量为客户端程序设置 Position 服务地址 docker run --net=host -it --env VSOA_POS_SERVER=127.0.0.1:1118 \ vsoa-demo:latest client demo # 或者通过文件为客户端程序设置 Position 服务地址 docker run --net=host -v ${PWD}/vsoa.pos:/etc/vsoa.pos -it \ vsoa-demo:latest client demo ```