• Stars
    star
    121
  • Rank 293,924 (Top 6 %)
  • Language
    Erlang
  • Created over 14 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Erlang RFC4627 (JSON) codec and JSON-RPC server implementation.

RFC4627 (JSON) and JSON-RPC for Erlang

An implementation of JSON and JSON-RPC for Erlang.

See rfc4627.erl, the JSON/RFC4627 codec itself, to learn how to encode and decode JSON objects from Erlang code.

Providing and calling JSON-RPC services

See rfc4627_jsonrpc.erl, a JSON-RPC service registry and transport-neutral service method invocation mechanism, to learn how to expose Erlang processes as remotely-callable JSON-RPC services, and to learn how to invoke local JSON-RPC services from Erlang without the overhead of HTTP.

Exposing JSON-RPC services over HTTP

Using Inets

See rfc4627_jsonrpc_inets.erl, an Inets HTTP transport binding for JSON-RPC, to learn how to configure the Inets HTTP server to respond to JSON-RPC requests.

Using Mochiweb

See rfc4627_jsonrpc_mochiweb.erl to learn how to delegate incoming Mochiweb HTTP requests to the JSON-RPC service dispatcher.

Using Cowboy

See rfc4627_jsonrpc_cowboy.erl to learn how to delegate incoming Cowboy HTTP requests to the JSON-RPC service dispatcher.

Running the example test service that comes with the source code

Included with the Erlang RFC4627 source code is a small Inets-based example that defines a "hello world"-style JSON-RPC service, and calls it from a Javascript program embedded in a web page.

At your Erlang shell,

  • after compiling the code with make all test-compile,
  • when your current working directory contains the test directory from the distribution, such that ./test/server_root/conf/httpd.conf exists,

type test_jsonrpc_inets:start_httpd(). (Don't forget the trailing "."!) This will

  • start the inets httpd on port 5671 (from ./test/server_root/conf/httpd.conf)
  • allow HTTP access to JSON-RPC services via a url prefix of /rpc (again from httpd.conf)
  • start the rfc4627_jsonrpc service registry
  • register the test service

Visiting http://localhost:5671/ in your browser should load a page that uses javascript to invoke the Erlang-implemented JSON-RPC test service.

Invoking JSON-RPC procedures from Javascript

See the relevant section of the edoc documentation included with the source code.

References

Contributors

The codebase and documentation was originally written between 2007 and 2010 by Tony Garnock-Jones while at LShift in London. Since then, it has been maintained by Tony and enhanced with a few generous contributions from others:

  • András Veres-Szentkirályi
  • Eugene Volchek
  • Simon MacMullen
  • Andrey Khozov
  • Erik Timan

Copyright and Licence

Copyrights:

  • Copyright © 2007-2010, 2011, 2012 Tony Garnock-Jones.
  • Portions copyright 2007-2010 LShift Ltd.
  • Portions copyright contributors to the project, listed above.

License (MIT):

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

More Repositories

1

js-nacl

Pure-Javascript High-level API to Emscripten-compiled libsodium routines.
JavaScript
491
star
2

rabbithub

Experimental RabbitMQ PubSubHubBub interface
Erlang
228
star
3

reversehttp

A dynamic, ReST-style means of enrolment and participation in an HTTP network; a dynamically-configurable "Remote CGI" service. Joining the World Wide Web as an HTTP server has been an ad-hoc, manual process. By using the protocol defined here, programs can provide services to the Web just as easily as they request services from the Web.
Java
220
star
4

js-scrypt

Emscripten-compiled Javascript version of scrypt, a high-quality password-based key derivation function.
JavaScript
164
star
5

syndicate

syn·di·cate: a language for interactive programs
Racket
151
star
6

pi-nothing

i386, x86_64, ARMv7 assembler/linker; Nothing-like mid-level language; Linear-scan register allocator; Operating system for Raspberry Pi
Racket
99
star
7

erlang-serial

Erlang serial-port support; based on serial-1.0 by Johan Bevemyr
C
89
star
8

rabbiter

Microblogging using RabbitMQ and ejabberd
Erlang
75
star
9

marketplace

Repository has moved: https://git.syndicate-lang.org/syndicate-lang/marketplace-2014
73
star
10

rmacs

An EMACS written in Racket. Runs in ANSI-compatible terminals.
Racket
72
star
11

racket-reloadable

Support for code-reloading for long-running racket programs (such as web-servers).
Racket
60
star
12

python-rfc3339

Implementation of the majority of RFC 3339 for python.
Python
55
star
13

udp-exchange

Extends RabbitMQ Server with support for a new experimental exchange type, `x-udp`.
Erlang
50
star
14

synchrotron

A Javascript JSON DVCS underpinning a Smalltalk-like image holding code & data in a single HTML file. A bit like Tiddlywiki. Work in progress. Also, little modules for diff, diff3, and merge of text etc.
HTML
42
star
15

script-exchange

RabbitMQ "Script Exchange" plugin
Erlang
41
star
16

racket-rfc6455

RFC 6455 WebSockets support for Racket.
Racket
40
star
17

racket-something

Indentation-based Racket Syntax
Racket
37
star
18

erlang-smtp

Erlang SMTP and POP3 server code.
Erlang
35
star
19

kali-scheme

Kali is Kelsey and Rees's distributed Scheme implementation based on Scheme48
Scheme
34
star
20

presence-exchange

An experimental RabbitMQ "Presence" exchange: notifies bound queues when other bindings appear and disappear
Java
32
star
21

racket-explorer

Utility for interactive exploration of complex data structures.
Racket
32
star
22

3-move

a multi-user networked online text-based programmable virtual environment
C
31
star
23

racket-bitsyntax

Erlang-style binaries/bitstrings for Racket
Racket
31
star
24

erlang-scrypt

Erlang port driver for Colin Percival's "scrypt" function.
C
25
star
25

erlang-ircd

A pluggable IRC daemon application/library for Erlang.
Erlang
23
star
26

js-vau

Kernel-like interpreter
JavaScript
22
star
27

camstream

Camstream uses AMQP to route live, streaming video from one or more webcams to one or more displays.
Java
22
star
28

racket-monad

Monads for Racket (!)
Racket
21
star
29

revctrl.org

An extract, as complete as I can make it, of content from the revctrl.org wiki
Python
21
star
30

racket-ansi

ANSI and VT10x escape sequences for Racket.
Racket
18
star
31

rabbitmq-xmpp

RabbitMQ XMPP gateway
Erlang
16
star
32

erlang-nacl

Erlang binding to NaCl in the form of libsodium.
C
15
star
33

racket-packet-socket

Access to raw Ethernet frames from Racket
Racket
14
star
34

racket-operational-transformation

Implements Operational Transformation (OT) for Racket.
Racket
14
star
35

squeaker

Like Docker, but for Squeak. You know, for kids.
Python
14
star
36

racket-nat-traversal

Racket implementation of NAT traversal utilities for opening ports on home routers.
Racket
13
star
37

ocaml-networking

Network server programming with OCaml
OCaml
12
star
38

squeak-actors

Erlang-style Actors for Squeak. http://tonyg.github.io/squeak-actors/
CSS
12
star
39

racket-reloadable-example

A simple website written with the Racket webserver, supporting runtime code-reloading.
Racket
12
star
40

racket-stomp

An implementation of the STOMP 1.1 protocol (client) for Racket
Racket
12
star
41

smlnj-networking

Network server programming with SML/NJ and CML
Standard ML
11
star
42

minimart

Repository has moved: https://git.syndicate-lang.org/syndicate-lang/minimart-2014
11
star
43

stoj

A join-calculus-based programming language for exploring description, simulation, and visualization of biochemical systems modelled as concurrent, rate-limited processes.
Java
10
star
44

prex

Prex is an open source, royalty-free, real-time operating system for embedded systems.
C
9
star
45

rust-scheme

I am teaching myself Rust by failing a lot.
Rust
9
star
46

newmoon

A naïve continuation-passing-style-transform based compiler for a language asymptotically approaching R5RS Scheme.
Scheme
9
star
47

delta-t-udp

Experiments in constructing a Delta-t-like protocol atop UDP.
8
star
48

python-supercollider

Communicate with the Supercollider server using python instead of the language and GUI
Python
8
star
49

hop

Repository has moved: https://git.syndicate-lang.org/syndicate-lang/hop-2012
7
star
50

racl

Racket bindings for nacl.cr.yp.to
Racket
7
star
51

streaming-bt

Experiments in N-way queue replication
Erlang
7
star
52

racket-unix-signals

Sending and handling Unix signals from Racket
Racket
7
star
53

racketmq

Repository has moved: https://git.syndicate-lang.org/syndicate-lang/racketmq-2017
7
star
54

erlang-xmpp-component

XMPP Component Protocol (XEP-0114) Library for Erlang
Erlang
7
star
55

js-marketplace

Repository has moved: https://git.syndicate-lang.org/syndicate-lang/js-marketplace-2014
7
star
56

racket-auxiliary-macro-context

Syntactic extensibility outside expressions.
Racket
6
star
57

webcam-snapshot-osx

Java Quicktime code for grabbing frames off a webcam on OS X
Java
6
star
58

texpict.rkt

Embed LaTeX snippets in picts for e.g. slideshow usage
Racket
6
star
59

erlang-openmoko

Erlang Openmoko userland replacement for gsmd/frameworkd/dialer/sms/addressbook etc.
Erlang
6
star
60

marketplace-dns

Repository has moved: https://git.syndicate-lang.org/syndicate-lang/marketplace-dns-2014
6
star
61

multicast-sync-experiments

Experiments in using multicasting to synchronise participants in a distributed topic
Erlang
5
star
62

xcb-shim

Intermediate form of XCB protocol specification data structures, to make it easier to build native bindings rather than wrapping libxcb
Python
5
star
63

passthru

TCP proxy tool for getting a (hex) dump of everything that passes by. Useful for protocol analysis and debugging.
C
5
star
64

erlang-jukebox

An Erlang Jukebox server
Python
5
star
65

racket-effects

Delimited-continuation-based effects for Racket
Racket
5
star
66

rais

C
5
star
67

scheme-httpd

A simple HTTP daemon, written in R5RSish Scheme
Scheme
5
star
68

stomp

A ruby gem for sending and receiving messages from a Stomp protocol compliant message queue.
Ruby
5
star
69

racket-abnf

ABNF parser implementation #lang for Racket.
Racket
5
star
70

minimart-netstack

Repository has moved: https://git.syndicate-lang.org/syndicate-lang/minimart-netstack-2014
5
star
71

racket-font

First-principles font rendering for Racket
Racket
5
star
72

marketplace-ssh

Repository has moved: https://git.syndicate-lang.org/syndicate-lang/marketplace-ssh-2014
5
star
73

pyle2

A python WikiClone
Python
4
star
74

racket-dbus

Native D-Bus Client For Racket
Racket
4
star
75

barebones-android

Scavenging a kernel, initramfs, and recovery tooling from a Cyanogenmod installation, and using them to make a horrible Frankenstein's monster.
C
4
star
76

rabbitmq-universe

Scripts for building packages for RabbitMQ server and plugins
Python
4
star
77

racket-timers

Timer event utilities that integrate well with (sync).
Racket
4
star
78

gst-cairo-widgets

A widget library for GNU Smalltalk built on SDL and Cairo
Smalltalk
4
star
79

racket-opencv-videocapture

Simple FFI binding to opencv video capture routines from Racket
Racket
4
star
80

mixfix

A mixfix parsing system after Danielsson and Norell 2008
Racket
4
star
81

racket-content-defined-chunking

Content-Defined Chunking, after rsync / Rabin fingerprinting / FastCDC / Ronomon's algorithm.
Racket
4
star
82

cl-match

NOTE: SUPERSEDED BY OPTIMA, https://github.com/m2ym/optima. Bug fixes for Daniel S. Bensen's CL-MATCH common-lisp pattern matching library
Common Lisp
4
star
83

json-shapes

Schema validation and other goodies for JSON data
JavaScript
4
star
84

racket-google

Google APIs (Drive, Plus, ...) for Racket.
Racket
4
star
85

racket-camstream

A Racket camdisplay implementation compatible with the original.
Racket
3
star
86

racket-send-exp

Terse syntax for object-oriented message sending
Racket
3
star
87

ohm-ecmascript-extension-example

Example demonstrating syntactic extension of ES5 using Ohm.
JavaScript
3
star
88

racket-struct-defaults

Default values in struct ctors and patterns.
Racket
3
star
89

racket-pkg-server

Racket package catalog server setup scripts and ops documentation
Shell
3
star
90

racket-inverted-index

Playing around with inverted indexing for Racket
Racket
3
star
91

racket-ohm

An Ohm-style parsing package.
Racket
3
star
92

racket-salty-crypto

libsodium and libb2 bindings for Racket, plus an implementation of the Noise Protocol Framework
Racket
3
star
93

pgg

The PGG system is Peter Thiemann's partial evaluation system for the programming language Scheme.
Scheme
3
star
94

racket-critbit

Critbit trees in Racket
Racket
3
star
95

racket-portaudio

FFI bindings to PortAudio, http://portaudio.com/
Racket
3
star
96

racket-opus

FFI bindings to Opus, http://www.opus-codec.org/
Racket
3
star
97

js-voice

Audio-processing libraries for Javascript suitable for simple VOIPish applications
JavaScript
3
star
98

racket-scrypt

Racket binding to Colin Percival's "scrypt" function.
Racket
3
star
99

gyre

A simple CMS, usable as a blog or wiki.
Python
3
star
100

racket-pretty-printing-combinators

Pretty-printing combinators for Racket.
Racket
2
star