1.7.2 • Published 6 years ago

nats-proxy v1.7.2

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

nats-proxy

This proxy server allows clients to arbitrarily specify a NATS.io subject and publish messages directly to NATS.io without using the default NATS.io client libraries.

Install

$ npm install -g nats-proxy

Usage

$ nats-proxy --help

NATS.io messaging proxy

usage: nats-proxy [options]

options:
  -p --port    Port number (Default: 8080)
  -n --nats    NATS server URL (Default: nats://0.0.0.0:4222)
  -d --debug   Enable debug output
  -t --tls     Enable TLS / HTTPS
  -C --cert    Server certificate file
  -K --key     Private key file
  -h --help    Print this list and exit
  -v --version Print the current version

Publishing data to NATS

External clients can issue HTTP post requests to the default route / and publish messages directly to NATS.io, for example:

curl -s -H "Content-Type: application/json" \
-X POST -d '{"__subject":"CUSTOMER","account":"ACC-123456789","orders":"PO-123456789"}' \
http://localhost:8080/

This command will post the JSON data to the default route http://localhost:8080/, the nats-proxy server will read and parse the JSON data and will publish this data to NATS.io with a subject called CUSTOMER.

Monitoring

You can monitor nats-proxy and view live stats by accessing the http://localhost:8080/.

Run in Docker container

You can run nats-proxy in a Docker container as follows:

# pull the image
docker pull aaguilar/nats-proxy

# run the container
docker run -it --rm -p 8080:8080 aaguilar/nats-proxy -p 8080 -n nats://localhost:4222
1.7.2

6 years ago

1.7.1

6 years ago

1.7.0

6 years ago

1.5.0

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.7

7 years ago

1.2.6

7 years ago

1.2.5

7 years ago

1.2.4

7 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago