hyphacoop / openarchive-dweb-backend

A project to integrate decentralized tooling into OpenArchive's Save app
GNU General Public License v3.0
0 stars 0 forks source link

Figure out IPC connection #14

Closed RangerMauve closed 1 month ago

RangerMauve commented 3 months ago

We need to lay the foundation for doing rpc between the backend and the frontend. One approach would be to make use of unix domain sockets to register a listener on the backend and send requests to it on the frontend.

Phase 1: Rust unix domain registration

Phase 2: Mobile connection

Phase 3: HTTP over unix domain socket

RangerMauve commented 3 months ago

For android we might need to find an HTTP library which can be passed a socket instance or write a library ourselves :skull:

https://stackoverflow.com/questions/10673684/send-http-request-manually-via-socket

RangerMauve commented 3 months ago

Worst case we can ditch http and do a custom protocol

RangerMauve commented 2 months ago

If the http path doesn't work out we could use protocol buffers with some adhoc rpc protocol. or maybe json rpc?

RangerMauve commented 2 months ago

https://github.com/apple/swift-protobuf

RangerMauve commented 2 months ago

Alternately we can use gRPC

https://github.com/grpc/grpc-swift

https://grpc.io/docs/languages/kotlin/

https://github.com/hyperium/tonic

writerly03 commented 1 month ago

Phase 2 done: https://github.com/OpenArchive/save-android

RangerMauve commented 1 month ago

Richard ended up going with HTTP for part 2 anyway and just implemented the HTTP connection over sockets manually.