json rpc android,Android JSON-RPC tunneled in websocket

That's a pretty specific thing to "support". Websockets are just a bi-directional communications protocol implemented over HTTP (the HTTP part of the request does an "upgrade" to allow the TCP socket to be reused, in much the same way as HTTPS).

How?

Just pick any implementation of Websockets for Android that you're comfortable with. Perhaps Autobahn ?

To "tunnel" JSON-RPC over that, for example, you could sub-class the JSONRPCClient class in android-json-rpc (overriding the doJSONRequest method in much the same way JSONRPCHttpClient does) naming your implementation JSONRPCWebsocketsClient (to make use of whichever Websockets implementation you chose).

Why?

A more important question would be why you need to tunnel JSON-RPC over Websockets?

Are you going to use the (asymmetric, server-to-client) "notification" messages from the older JSON-RPC proposals? (I would!)

Are you stuck talking to some very specific server-side implementation?

Is this just to get past some silly corporate firewall?

If it's just for "notification" messages, then why not do this over plan TCP (more lightweight) rather than Websockets (which are significantly more complicated).

If it's to work with some specific server implementation, your options are "live with it" or to put a proxy server of some sort in between your clients and the server.

If it's to make use of HTTP to bypass a corporate firewall (perhaps in combination with needing server-to-client "notification" messages) then while this might be a "good" solution, an easier one might be to actually get support from ITS within said corporation to expose a secured, well-known endpoint without whatever restrictions are currently holding you back.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值