Very rough http proxy for communicating with Grapevine from a MUD/MOO. Uses the gossiphaus
NPM module to communicate with gossip and listens on an http port for commands from the MUD/MOO.
run with Node.js 8.x
-
cp config/template.js config/<configname>.js
-
vi config/<configname>.js
-
(enter your details,
ESC:wq
to save) -
export NODE_ENV=<configname>
-
npm start
config keys to edit:
http.port
- the http port your MUD/MOO will talk to send messages to gossipdebug
- set totrue
for moar logging infoutf8
- iffalse
or missing, will strip non ASCII characters.gossip.client_id
gossip.client_secret
gossip.channels
- gossip channels this proxy will relay to the MUD/MOOban.path
- this file will be monitored for changes everyban.interval
milliseconds (expected format of each line:name@game|||whatever
)who.path
- this file will be monitored for changes everywho.interval
milliseconds (expected fields: Name , idle_seconds, is_ic, bit, who_hidden, profile, object, connection_host, session_token, wow, separated by::
)moo.host
- where your MUD/MOO is hostedmoo.port
- what port your MUD/MOO listens for machine requests (might be your main port)moo.secret
- a token value that shows your trusted to send a machine request to the MUD/MOOmoo.commands
- each of these is a command your MUD/MOO needs to support from unauthenticated users. When a command is sent, the first parameter will be themoo.secret
defined in your config file.
MUD/MOO command format:
RECEIVE_BROADCAST: ${config.moo.commands.RECEIVE_BROADCAST} ${MOO_SECRET} "${payload.channel}" "${payload.name}@${payload.game}" ${msg}
RECEIVE_TELL: ${config.moo.commands.RECEIVE_TELL} ${MOO_SECRET} "${payload.from_game}" "${payload.from_name}" "${payload.to_name}" ${msg}
PLAYER_SIGNIN: ${config.moo.commands.PLAYER_SIGNIN} ${MOO_SECRET} "${payload.name}@${payload.game}"
PLAYER_SIGNIN: ${config.moo.commands.PLAYER_SIGNOUT} ${MOO_SECRET} "${payload.name}@${payload.game}"
RESTful API exposed:
/v1/channels/send/
: POST
JSON
body parameter: payload={ name, message, channel }