mkschreder / orangerpcd

Websocket RPC server for OpenWRT
Other
27 stars 11 forks source link

What is a difference with ubus over http? #19

Closed stokito closed 5 years ago

stokito commented 5 years ago

I just found your project and still didn’t get it’s intention. Uhttpd has support for Ubus gateway so we can call any ubus service over http with JSON-RPC. That’s looks very similar to what this project do. The only difference is that in orange you use websocjets and Lua. Did I correctly got the point? What is advantages or difference in comparison with Uhttpd +ubus?

mkschreder commented 5 years ago

In 2016 when I started JUCI there was luci2 which got some of the concepts right and had a basic jsonrpc interface but was entirely unmanagable to code against and not very useful. So I implemented what I considered necessary at the time.

One of these things was the completely standalone orangerpcd rpc server which does not need ubus but can be used to forward rpc calls to ubus services. This allowed better access control and ability to not expose all ubus services to the UI (I consider ubus to be for interprocess talk primarily and not something to be exposed in its entirety over rpc interface). It also allowed JUCI base services to be fairly standalone and usable with only lua rpc calls that called shell scripts to communicate with the system.

Also none of the ubus libraries are usable in a multithreaded application. This was another reason to write a custom rpcd using code that is reentrant.

On Wed, 26 Dec 2018, 23:54 Sergey Ponomarev <notifications@github.com wrote:

I just found your project and still didn’t get it’s intention. Uhttpd has support for Ubus gateway so we can call any ubus service over http with JSON-RPC. That’s looks very similar to what this project do. The only difference is that in orange you use websocjets and Lua. Did I correctly got the point? What is advantages or difference in comparison with Uhttpd +ubus?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mkschreder/orangerpcd/issues/19, or mute the thread https://github.com/notifications/unsubscribe-auth/AERqibc-HCKjjE8ujPBGMxRuhHIIoyGbks5u8_4ngaJpZM4ZiJeM .

stokito commented 5 years ago

Thank you for your explanation