{"id":16939193,"url":"https://github.com/vnpy/vnpy_webtrader","last_synced_at":"2026-04-07T05:31:30.828Z","repository":{"id":42670193,"uuid":"387311698","full_name":"vnpy/vnpy_webtrader","owner":"vnpy","description":"VeighNa框架的Web端管理服务器","archived":false,"fork":false,"pushed_at":"2025-06-12T08:02:16.000Z","size":104,"stargazers_count":57,"open_issues_count":0,"forks_count":59,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-03-21T06:14:35.212Z","etag":null,"topics":["veighna","vnpy","webserver"],"latest_commit_sha":null,"homepage":"https://www.vnpy.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vnpy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-07-19T02:04:15.000Z","updated_at":"2026-03-18T08:06:10.000Z","dependencies_parsed_at":"2025-07-05T09:01:40.019Z","dependency_job_id":null,"html_url":"https://github.com/vnpy/vnpy_webtrader","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/vnpy/vnpy_webtrader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vnpy%2Fvnpy_webtrader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vnpy%2Fvnpy_webtrader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vnpy%2Fvnpy_webtrader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vnpy%2Fvnpy_webtrader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vnpy","download_url":"https://codeload.github.com/vnpy/vnpy_webtrader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vnpy%2Fvnpy_webtrader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31501903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["veighna","vnpy","webserver"],"created_at":"2024-10-13T21:03:56.788Z","updated_at":"2026-04-07T05:31:30.798Z","avatar_url":"https://github.com/vnpy.png","language":"Python","funding_links":[],"categories":["VNPY"],"sub_categories":[],"readme":"# VeighNa框架的Web服务模块\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src =\"https://vnpy.oss-cn-shanghai.aliyuncs.com/vnpy-logo.png\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"https://img.shields.io/badge/version-1.1.0-blueviolet.svg\"/\u003e\n    \u003cimg src =\"https://img.shields.io/badge/platform-windows|linux|macos-yellow.svg\"/\u003e\n    \u003cimg src =\"https://img.shields.io/badge/python-3.10|3.11|3.12|3.13-blue.svg\" /\u003e\n    \u003cimg src =\"https://img.shields.io/github/license/vnpy/vnpy.svg?color=orange\"/\u003e\n\u003c/p\u003e\n\n## 说明\n\n针对B-S架构需求设计的Web服务应用模块，实现了提供主动函数调用（REST）和被动数据推送（Websocket）的Web服务器。\n\n目前仅提供了基础的交易和管理接口，用户根据自己的需求扩展支持其他VeighNa应用模块的Web接口（如CTA策略自动交易等）。\n\n## 安装\n\n安装环境推荐基于4.0.0版本以上的【[**VeighNa Studio**](https://www.vnpy.com)】。\n\n直接使用pip命令：\n\n```\npip install vnpy_webtrader\n```\n\n\n或者下载源代码后，解压后在cmd中运行：\n\n```\npip install .\n```\n\n\n## 架构\n\n* 基于Fastapi-Restful实现的主动函数调用功能，数据流程：\n\t1. 用户点击浏览器中的某个按钮，发起Restful功能调用；\n\t2. Web服务器收到Restful请求，将其转化为RPC功能调用发送给交易服务器；\n\t3. 交易服务器收到RPC请求，执行具体的功能逻辑，并返回结果；\n\t4. Web服务器返回Restful请求的结果给浏览器。\n\n* 基于Fastapi-Websocket实现的被动数据推送功能，数据流程：\n\t1. 交易服务器的事件引擎转发某个事件推送，并推送给RPC客户端（Web服务器）；\n\t2. Web服务器收到事件推送后，将其转化为json格式，并通过Websocket发出；\n\t3. 浏览器通过Websocket收到推送的数据，并渲染在Web前端界面上。\n\n* 将程序分为两个进程的主要原因包括：\n\t1. 交易服务器中的策略运行和数据计算的运算压力较大，需要保证尽可能保证低延时效率；\n\t2. Web服务器需要面对互联网访问，将交易相关的逻辑剥离能更好保证安全性。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvnpy%2Fvnpy_webtrader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvnpy%2Fvnpy_webtrader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvnpy%2Fvnpy_webtrader/lists"}