Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-local IPC or HTTP server extension or Endpoint Service #263

Open
pattontim opened this issue Nov 25, 2022 · 0 comments
Open

Non-local IPC or HTTP server extension or Endpoint Service #263

pattontim opened this issue Nov 25, 2022 · 0 comments

Comments

@pattontim
Copy link

pattontim commented Nov 25, 2022

Description

Allow plugins to utilize a server for serving files and exposing HTTP endpoints for controlling SMA features, or implement IPC over HTTP.

Sketches, Videos, ...

  • IPC is used to get info from browser for example, we could allow a browser to request html files from SMA over HTTP
  • http://localhost:8000/yt.htm? -> serves yt.htm from the root dir
  • http://localhost:8000/nextElement -> fires an endpoint with code in SMA with a routine defined to handle it.

The behaviour is similar to RemotingServicesEx as used in the BrowserPlugin but instead you have a ServerEx which you can define endpoints on creation.

Environment

All plugins support this feature through imports.

Motivation

To implement endpoints for a UI extending the functionality and communicating with SMA over the internet. HTML could be sent to and from the extending UI to implement a new SuperMemo UI over the internet. SMA enacts the relevant changes in SM state. A big percent of the user base might use the HTTP code in this if a SM replacement UI can be made pleasant enough or virtual machines can be used in lieu of Windows requirement.

Documentation-type explanation

Same as using IPC for example in the BrowserNativeHost. The relevant methods linking endpoints can be defined. Like ServerEx.defineEndpoint("/", funcToCall, data, params)
If a sevice is implemented, I'd expect different plugins to be called by plugin name for http://localhost:8000/YouTubeJukebox/getYTUrl

Drawbacks

Data sent over HTTP may be not private. Actors could hijack the endpoints. It may be simple enough to import an external server library directly. It may be better practice to write an independent server and communicate SMA via derivatives of the existing IPC extension. Hosting a server in plugins may have too much threading overhead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant