项目作者: mammadmodi

项目描述 :
PubSub Messaging Over Websocket.
高级语言: Go
项目地址: git://github.com/mammadmodi/websub.git
创建时间: 2021-05-01T10:29:40Z
项目社区:https://github.com/mammadmodi/websub

开源协议:

下载


WEBSUB

Test
GitHub go.mod Go version (branch & subdirectory of monorepo)
codecov

  1. _______ ______ _______ ______
  2. |\ /|( ____ \( ___ \ ( ____ \|\ /|( ___ \
  3. | ) ( || ( \/| ( ) )| ( \/| ) ( || ( ) )
  4. | | _ | || (__ | (__/ / | (_____ | | | || (__/ /
  5. | |( )| || __) | __ ( (_____ )| | | || __ (
  6. | || || || ( | ( \ \ ) || | | || ( \ \
  7. | () () || (____/\| )___) )/\____) || (___) || )___) )
  8. (_______)(_______/|/ \___/ \_______)(_______)|/ \___/

Easily make a real time communication core between your users and your microservices through web socket with power of
redis or nats.

alt text

Quick Setup

Simply run docker-compose -f ./test/docker-compose.yaml up. It will set up a redis instance and a websub instance
that listens to port 8379.

Connect to Websub

In browser go to the websub_sample form
and start a websocket connection by clicking on “open” button. It will create a websocket connection to websub and
websub will create subscriptions to topics “johntopic1” and “johntopic2”
for the user.

Send Messages to User

Now you can send messages to your client through redis:

Publish to the topic “jonhtopic1”

docker-compose -f ./test/docker-compose.yaml exec redis /bin/sh -c "redis-cli publish johntopic1 hello-john"

Publish to the topic “jonhtopic2”

docker-compose -f ./test/docker-compose.yaml exec redis /bin/sh -c "redis-cli publish johntopic2 hello-john"