Coder Social home page Coder Social logo

catwebrpc's Introduction

CatWebRPC

适用于Web爬虫领域的RPC解决方案

服务器

catserver Wamp路由 基于 express fox-wamp autobahn

npm i express
npm i body-parser
npm i fox-wamp
npm i autobahn

网页服务

CatWebService.js 基于Wampy.js 对部分代码进行了修改

使用方法

1.首先运行服务器

node catserver.js  设置ip和端口

2.网页插入CatWebService.js运行

3.在需要的位置调用

//window.catwampy.register(topic,func,opt)
//topic: 同java包名类似  域.名.方法名
//func: js的function  需要调用的方法
//opt: 同Wampy.js opt参数一致 另外增加了一个concurrency 并发设置 一般不需要设置 或者根据需求填写

//如下 注册了一个zhiyuan方法 给定并发(同时的请求)设置为10
window.catwampy.register('cat.rpc.zhiyuan', zhiyuan, { concurrency: 10 });

  1. 任意语言远程调用
POST请求
POST http://IP:PROT/call?topic=接口的topic HTTP/1.1
Content-Type: application/json

["参数1","参数2",1,true,1.1,{}]  //类似json 支持不同类型  类似js apply(this,参数数组) 中的参数数组

catwebrpc's People

Contributors

x0tools avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.