1.0.7 • Published 4 years ago

@ricejs/proxy v1.0.7

Weekly downloads
2
License
ISC
Repository
-
Last release
4 years ago

If you want to access B rice Server,but your client cant't access it。

If your client can access A rice server, let A rice server make a proxy, help your client to access B rice server

Server

A rice server rice.js config add this:

{
    _:{},
    proxy:{
        lib:"@ricejs/proxy"
    }
}

Client

const Proxy=require("@ricejs/proxy/client") 

// when you get A rice client
let arice = getArice();
let bRiceServerUrl="https://some.com/abc";
new Proxy(arice,bRiceServerUrl,{
    'minie':[ //bRiceServer moudle name
        'get',//router method name
        'set',//router method name
    ]
})

Now your cant access b rice server method like this:

let result = await arice.minie.get("a")
1.0.7

4 years ago

1.0.6

4 years ago

1.0.0

4 years ago