Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skangas/url-scgi
SCGI support for Emacs using url.el
https://github.com/skangas/url-scgi
Last synced: 7 days ago
JSON representation
SCGI support for Emacs using url.el
- Host: GitHub
- URL: https://github.com/skangas/url-scgi
- Owner: skangas
- License: gpl-3.0
- Created: 2022-09-22T14:43:10.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-22T16:11:12.000Z (about 1 year ago)
- Last Synced: 2024-11-26T07:40:54.155Z (2 months ago)
- Language: Emacs Lisp
- Size: 50.8 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- Funding: .github/FUNDING.yml
- License: COPYING
Awesome Lists containing this project
README
#+TITLE: url-scgi.el
#+DATE: 2023-01-30
#+AUTHOR: Stefan Kangas[[https://elpa.gnu.org/packages/url-scgi.html][https://elpa.gnu.org/packages/url-scgi.svg]]
This library adds support for Simple Common Gateway Interface (SCGI) URLs to the
built-in Emacs ~url~ library.The SCGI protocol is intended as a replacement for the older CGI protocol, and
is comparable to FastCGI or WAI, but much simpler. Thus, the SCGI protocol is
most often used by web servers to communicate with a program that serves
dynamically generated pages and files (instead of just static ones). SCGI is
supported in web servers such as Apache, lighttpd, and nginx.This library effectively makes Emacs take the place of a web server. This can
be useful for testing, but not only that. It was originally developed for
[[https://www.github.com/skangas/mentor][Mentor]], an Emacs front-end for the BitTorrent client ~rtorrent~, where it is
used for remote procedure calls (RPC).SCGI is described in more detail on [[https://en.wikipedia.org/wiki/Simple_Common_Gateway_Interface][Wikipedia]]. As far as I know, there is no
RFC describing SCGI, nor is there any formal specification. On the other hand,
the protocol is very simple; it is described in detail [[https://python.ca/scgi/protocol.txt][here]].SCGI URLs look like this: ~scgi://:~. See below for an example.
* Installation
url-scgi.el can be installed from [[https://elpa.gnu.org/][GNU ELPA]], an Emacs Lisp package archive that
is enabled by default in Emacs.Find and install url-sgi.el using this command:
: M-x list-packages
** Usage
First, require ~url-scgi~:
: (require 'url-scgi)
Now, to make an SCGI request with ~url-scgi~, simply call ~url-retrieve~ or
~url-retrieve-synchronously~ with a URL starting with ~scgi://~.For example, let's assume you have some program listening for SCGI requests on
~localhost~ port ~5000~. You can then issue a request containing the string
~some-data~ with:: (url-retrieve-synchronously "scgi://localhost:5000/some-data")
You will want to replace ~some-data~ with something relevant to the program you
are talking to. Please refer to its documentation for details.If your application supports XML-RPC (remote procedure calls) over SCGI, you can
make such calls using ~url-scgi~ with the ~xml-rpc~ package. For example, if
your program supports an XML-RPC method named ~foo~, you would call it like
so:: (require 'url-scgi)
: (require 'xml-rpc)
: (xml-rpc-method-call "scgi://localhost:5000" "foo")For more, see the documentation of the ~xml-rpc~ package.
** Contribute
This library is part of [[https://elpa.gnu.org/packages/url-scgi.html][GNU ELPA]] and therefore requires a [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Copyright-Assignment.html][copyright assignment]]
to the [[https://www.fsf.org/][Free Software Foundation]] for any non-trivial contributions.Please email me a patch, or open a pull request on GitHub, according to your
preferences.** Contact
You can find the latest version of url-scgi.el here:
https://www.github.com/skangas/url-scgi
Bug reports, comments, and suggestions are welcome! Email them to Stefan Kangas
or report them on GitHub.