{"id":20586950,"url":"https://github.com/imzlh/webrpc","last_synced_at":"2026-04-16T11:02:36.628Z","repository":{"id":222127988,"uuid":"756316406","full_name":"imzlh/WebRPC","owner":"imzlh","description":"Perfect RPC Module for both Deno and Browser. 一个为双向调用而创造的RPC模块","archived":false,"fork":false,"pushed_at":"2024-02-19T09:30:29.000Z","size":557,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-05T13:44:08.340Z","etag":null,"topics":["deno","rpc","rpc-framework","web"],"latest_commit_sha":null,"homepage":"https://deno.land/x/webrpc/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imzlh.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-12T12:32:09.000Z","updated_at":"2024-07-24T19:14:46.000Z","dependencies_parsed_at":"2024-02-19T10:42:06.232Z","dependency_job_id":null,"html_url":"https://github.com/imzlh/WebRPC","commit_stats":null,"previous_names":["imzlh/webrpc"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/imzlh/WebRPC","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imzlh%2FWebRPC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imzlh%2FWebRPC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imzlh%2FWebRPC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imzlh%2FWebRPC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imzlh","download_url":"https://codeload.github.com/imzlh/WebRPC/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imzlh%2FWebRPC/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31882886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T09:23:21.276Z","status":"ssl_error","status_checked_at":"2026-04-16T09:23:15.028Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["deno","rpc","rpc-framework","web"],"created_at":"2024-11-16T07:14:35.382Z","updated_at":"2026-04-16T11:02:36.575Z","avatar_url":"https://github.com/imzlh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RPC 3\nRPC，在Windows上称作“远程过程调用”。作为系统的关键组件，在WinB上也无可辩驳地成为了通信核心\n\n此RPC支持双向JS调用、双向Pipe和调用链，让诸多有双向或短时间内单向调用需求的项目有了更多选择\n\n# 快速开始\n\n在 v1.1中，我们将三个文件合并成了一个 `mod.ts`.\nRPCBrowser给浏览器使用，RPC给Deno和浏览器共用\n\n## Deno\n\n    import { RPC, Env } from 'https://deno.land/x/webrpc/mod.ts';\n    Deno.serve(function(req){\n        const rpc = new RPC(),\n            {socket,response} = Deno.upgradeWebSocket(req);\n        rpc.socket = socket;\n        return response;\n    }\n    Env.provide('...',...)\n\n## 浏览器\n\n    // 这里使用了RPCBrowser，可以更方便地用在客户端上\n    // 当然，Deno做客户端也可以\n    import { RPCBrowser, Env } from 'mod.js';\n    const rpc = new RPCBrowser('ws://demo.com/rpc/ws');\n    // Env.provide('...',...)\n    // rpc.call(...)\n    // rpc.pipe(...)\n    // rpc.prepare(...).then(...).then(...).send(true)\n    // ...\n\n# 更多？\nRPC3是一个框架，支持 浏览器(browser.ts)、Deno端(直接使用mod.ts)、Bun(未测试)\n\n且经过小幅度改动或一个polyfill即可移植到NodeJS\n\n需要提前安装好 `typescript` 和 `deno`，然后：\n\n你可以试试看 `tsc \u0026\u0026 cd test \u0026\u0026 deno run -A --unstable-sloppy-imports deno.ts`运行简单的服务器\n简单修改即可投入生产使用\n\n![示例](image.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimzlh%2Fwebrpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimzlh%2Fwebrpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimzlh%2Fwebrpc/lists"}