go-hermes-prototype

command module
v0.0.0-...-0dbd40a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2018 License: MIT Imports: 14 Imported by: 0

README

Hermes

Hermes

Purpose

Hermes is an asynchronous pub-sub messaging system that uses the Websocket protocol to talk to its HTTP clients. It's meant to be used as a lightweight self-hosted replacement for Pusher.

Configuration

The following environment variables are recognised by the Go application:

Variable Mandatory Default
HERMES_HTTP_PORT no 8000
HERMES_NATS_URL no nats://localhost:4222
HERMES_WEBSOCKET_TIMEOUT no 15m
HERMES_LOGGING_LEVEL no info

Dependencies

Design

A NATS server has to run first for Hermes to work. Hermes uses NATS to handle the pub-sub functionality.

Hermes exposes an HTTP server that serves two routes:

  • /subscribe - clients can use it to initiate a websocket connection via HTTP GET and request subscription to mesages with a given "subject"
  • /publish - backend services can send messages to it via HTTP POST requests, which contain a query parameter subj that specifies the NATS "subject". Subsequently, Hermes will broadcast the received message to the clients that are subscribed to this "subject"

Hermes Architecture

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL