https://github.com/gerifield/epher
Event Pusher
https://github.com/gerifield/epher
events golang hacktoberfest http websocket
Last synced: 29 days ago
JSON representation
Event Pusher
- Host: GitHub
- URL: https://github.com/gerifield/epher
- Owner: Gerifield
- License: mit
- Created: 2017-02-17T09:32:16.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-10-13T08:02:12.000Z (over 2 years ago)
- Last Synced: 2024-06-21T19:08:09.292Z (over 1 year ago)
- Topics: events, golang, hacktoberfest, http, websocket
- Language: Go
- Homepage:
- Size: 47.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Event Pusher  [](https://coveralls.io/github/Gerifield/epher?branch=master)
This stuff allows users to subscribe to a given channel and let the services to send notifications to those channels with an HTTP request.
All the messages sent to the websocket endpoint will be dropped.
# Usage
```
-listen string
HTTP and WS server listen address (default ":9090")
-redisAddr string
Redis server address (optional)
-redisPass string
Redis server password (optional)
```
# Example
Start the server:
```
$ go run main.go
```
It'll start on port `9090` by default.
Connect with websocket to the subscribe endpoint (for example using websocat):
```
$ websocat ws://127.0.0.1:9090/subscribe/test1
```
Send HTTP post requests to the publish endpoint:
```
$ curl 127.0.0.1:9090/publish/test1 -d 'test message'
```
You should see your message in the websocket client.