💨 A real time messaging system to build a scalable in-app notifications, multiplayer games, chat apps in web and mobile apps.

Overview

Beaver Logo

Beaver

A Real Time Messaging Server.

Beaver is a real-time messaging server. With beaver you can easily build scalable in-app notifications, realtime graphs, multiplayer games, chat applications, geotracking and more in web applications and mobile apps.

Beaver Single Node

Documentation

Config & Run The Application

Beaver uses Go Modules to manage dependencies. First Create a dist config file.

$ cp config.yml config.dist.yml

Then add your app.*, log.*, redis_*, api.* ...etc.

app:
    mode: dev
    port: 8080
    domain: example.com
    secret: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD
    tls:
        status: off
        pemPath: cert/server.pem
        keyPath: cert/server.key

log:
    level: info
    path: var/logs

redis:
    addr: localhost:6379
    password:
    db: 0

api:
    token: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD

And then run the application.

$ go build beaver.go
$ ./beaver

// OR

$ go run beaver.go

// To Provide a custom config file
$ ./beaver -config=/custom/path/config.dist.yml
$ go run beaver.go -config=/custom/path/config.dist.yml

Or download a pre-built Beaver binary for your operating system.

$ curl -sL https://github.com/Clivern/Beaver/releases/download/x.x.x/beaver_x.x.x_OS.tar.gz | tar xz
$ ./beaver -config=config.dist.yml

Also running beaver with docker still an option.

$ mkdir -p $HOME/srv/beaver
$ mkdir -p $HOME/srv/beaver/configs
$ mkdir -p $HOME/srv/beaver/logs

$ cd $HOME/srv/beaver

$ curl -OL https://raw.githubusercontent.com/Clivern/Beaver/master/Dockerfile
$ curl -OL https://raw.githubusercontent.com/Clivern/Beaver/master/docker-compose.yml
$ curl -OL https://raw.githubusercontent.com/Clivern/Beaver/master/config.yml

$ cp config.yml ./configs/config.dist.yml
$ rm config.yml
# Update log.path to be the absolute path to config file on host machine ($HOME/srv/beaver/logs)
$ sed -i "s|var/logs|${HOME}/srv/beaver/logs|g" ./configs/config.dist.yml
$ sed -i "s|localhost:6379|redis:6379|g" ./configs/config.dist.yml

# Build and run containers
$ cd $HOME/srv/beaver/
$ docker-compose build
$ docker-compose up -d

API Endpoints

Create a Config app_name:

$ curl -X POST \
    -H "Content-Type: application/json" \
    -H "X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD" \
    -d '{"key":"app_name","value":"Beaver"}' \
    "http://localhost:8080/api/config"

Get a Config app_name:

$ curl -X GET \
    -H "Content-Type: application/json" \
    -H "X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD" \
    "http://localhost:8080/api/config/app_name"

{"key":"app_name","value":"Beaver"}

Update a Config app_name:

$ curl -X PUT \
    -H "Content-Type: application/json" \
    -H "X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD" \
    -d '{"value":"Beaver"}' \
    "http://localhost:8080/api/config/app_name"

Delete a Config app_name:

$ curl -X DELETE \
    -H "Content-Type: application/json" \
    -H "X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD" \
    "http://localhost:8080/api/config/app_name"

Create a Channel:

# Private Channel
$ curl -X POST \
    -H 'Content-Type: application/json' \
    -H 'X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD' \
    -d '{"name": "app_x_chatroom_1", "type": "private"}' \
    'http://localhost:8080/api/channel'

# Public Channel
$ curl -X POST \
    -H 'Content-Type: application/json' \
    -H 'X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD' \
    -d '{"name": "app_y_chatroom_1", "type": "public"}' \
    'http://localhost:8080/api/channel'

# Presence Channel
$ curl -X POST \
    -H 'Content-Type: application/json' \
    -H 'X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD' \
    -d '{"name": "app_z_chatroom_5", "type": "presence"}' \
    'http://localhost:8080/api/channel'

Get a Channel:

$ curl -X GET \
    -H 'Content-Type: application/json' \
    -H 'X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD' \
    -d '' \
    'http://localhost:8080/api/channel/app_x_chatroom_1'
{
    "created_at":1545573214,
    "listeners_count":0,
    "name":"app_x_chatroom_1",
    "subscribers_count":0,
    "type":"private",
    "updated_at":1545573214
}

$ curl -X GET \
    -H 'Content-Type: application/json' \
    -H 'X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD' \
    -d '' \
    'http://localhost:8080/api/channel/app_y_chatroom_1'
{
    "created_at":1545573219,
    "listeners_count":0,
    "name":"app_y_chatroom_1",
    "subscribers_count":0,
    "type":"public",
    "updated_at":1545573219
}

$ curl -X GET \
    -H 'Content-Type: application/json' \
    -H 'X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD' \
    -d '' \
    'http://localhost:8080/api/channel/app_z_chatroom_5'
{
    "created_at": 1545573225,
    "listeners": null,
    "listeners_count": 0,
    "name": "app_z_chatroom_5",
    "subscribers": null,
    "subscribers_count": 0,
    "type": "presence",
    "updated_at": 1545573225
}

Update a Channel app_y_chatroom_1:

$ curl -X PUT \
    -H 'Content-Type: application/json' \
    -H 'X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD' \
    -d '{"type": "private"}' \
    'http://localhost:8080/api/channel/app_y_chatroom_1'

Delete a Channel app_y_chatroom_1:

$ curl -X DELETE \
    -H 'Content-Type: application/json' \
    -H 'X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD' \
    -d '' \
    'http://localhost:8080/api/channel/app_y_chatroom_1'

Create a Client and add to app_x_chatroom_1 Channel:

$ curl -X POST \
    -H 'Content-Type: application/json' \
    -H 'X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD' \
    -d '{"channels": ["app_x_chatroom_1"]}' \
    'http://localhost:8080/api/client'
{
    "channels": [
        "app_x_chatroom_1"
    ],
    "created_at": 1545575142,
    "id": "69775af3-5f68-4725-8162-09cab63e8427",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoiNjk3NzVhZjMtNWY2OC00NzI1LTgxNjItMDljYWI2M2U4NDI3QDE1NDU1NzUxNDIiLCJ0aW1lc3RhbXAiOjE1NDU1NzUxNDJ9.EqL-nWwu5p7hJXWrKdZN3Ds2cxWVjNYmeP1mbl562nU",
    "updated_at": 1545575142
}

Get a Client 69775af3-5f68-4725-8162-09cab63e8427:

$ curl -X GET \
    -H 'Content-Type: application/json' \
    -H 'X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD' \
    -d '' \
    'http://localhost:8080/api/client/69775af3-5f68-4725-8162-09cab63e8427'
{
    "channels": [
        "app_x_chatroom_1"
    ],
    "created_at": 1545575142,
    "id": "69775af3-5f68-4725-8162-09cab63e8427",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoiNjk3NzVhZjMtNWY2OC00NzI1LTgxNjItMDljYWI2M2U4NDI3QDE1NDU1NzUxNDIiLCJ0aW1lc3RhbXAiOjE1NDU1NzUxNDJ9.EqL-nWwu5p7hJXWrKdZN3Ds2cxWVjNYmeP1mbl562nU",
    "updated_at": 1545575142
}

Subscribe a Client 69775af3-5f68-4725-8162-09cab63e8427 to a Channel app_z_chatroom_5:

$ curl -X PUT \
    -H 'Content-Type: application/json' \
    -H 'X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD' \
    -d '{"channels": ["app_z_chatroom_5"]}' \
    'http://localhost:8080/api/client/69775af3-5f68-4725-8162-09cab63e8427/subscribe'

Unsubscribe a Client 69775af3-5f68-4725-8162-09cab63e8427 from a Channel app_z_chatroom_5:

$ curl -X PUT \
    -H 'Content-Type: application/json' \
    -H 'X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD' \
    -d '{"channels": ["app_z_chatroom_5"]}' \
    'http://localhost:8080/api/client/69775af3-5f68-4725-8162-09cab63e8427/unsubscribe'

Delete a Client:

$ curl -X DELETE \
    -H 'Content-Type: application/json' \
    -H 'X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD' \
    -d '' \
    'http://localhost:8080/api/client/69775af3-5f68-4725-8162-09cab63e8427'

Publish to a Channel app_x_chatroom_1:

$ curl -X POST \
    -H 'Content-Type: application/json' \
    -H 'X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD' \
    -d '{"channel": "app_x_chatroom_1", "data": "{\"message\": \"Hello World\"}"}' \
    'http://localhost:8080/api/publish'

Broadcast to Channels ["app_x_chatroom_1"]:

$ curl -X POST \
    -H 'Content-Type: application/json' \
    -H 'X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD' \
    -d '{"channels": ["app_x_chatroom_1"], "data": "{\"message\": \"Hello World\"}"}' \
    'http://localhost:8080/api/broadcast'

Sample Frontend Client

function Socket(url){
    ws = new WebSocket(url);
    ws.onmessage = function(e) { console.log(e); };
    ws.onclose = function(){
        // Try to reconnect in 5 seconds
        setTimeout(function(){Socket(url)}, 5000);
    };
}

Socket("ws://localhost:8080/ws/$ID/$TOKEN");

Client:

Versioning

For transparency into our release cycle and in striving to maintain backward compatibility, Beaver is maintained under the Semantic Versioning guidelines and release process is predictable and business-friendly.

See the Releases section of our GitHub project for changelogs for each release version of Beaver. It contains summaries of the most noteworthy changes made in each release.

Bug tracker

If you have any suggestions, bug reports, or annoyances please report them to our issue tracker at https://github.com/clivern/beaver/issues

Security Issues

If you discover a security vulnerability within Beaver, please send an email to [email protected]

Contributing

We are an open source, community-driven project so please feel free to join us. see the contributing guidelines for more details.

License

© 2018, Clivern. Released under MIT License.

Beaver is authored and maintained by @Clivern.

Issues
  • Update module go-redis/redis to v7

    Update module go-redis/redis to v7

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | github.com/go-redis/redis | require | major | v6.15.8+incompatible -> v7.3.0 |


    Release Notes

    go-redis/redis

    v7.3.0

    Compare Source

    v7.2.0

    Compare Source

    v7.1.0

    Compare Source

    v7.0.1

    Compare Source

    v7.0.0

    Compare Source


    Renovate configuration

    :date: Schedule: At any time (no schedule defined).

    :vertical_traffic_light: Automerge: Disabled by config. Please merge this manually once you are satisfied.

    :recycle: Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    :no_bell: Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    merge 
    opened by renovate[bot] 5
  • Update module github.com/gin-gonic/gin to v1.7.4

    Update module github.com/gin-gonic/gin to v1.7.4

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | github.com/gin-gonic/gin | require | minor | v1.6.3 -> v1.7.4 |


    Release Notes

    gin-gonic/gin

    v1.7.4

    Compare Source

    v1.7.3

    Compare Source

    BUGFIXES

    v1.7.2

    Compare Source

    BUGFIXES

    v1.7.1

    Compare Source

    BUGFIXES

    v1.7.0

    Compare Source

    BUGFIXES
    • fix compile error from #​2572 (#​2600)
    • fix: print headers without Authorization header on broken pipe (#​2528)
    • fix(tree): reassign fullpath when register new node (#​2366)
    ENHANCEMENTS
    • Support params and exact routes without creating conflicts (#​2663)
    • chore: improve render string performance (#​2365)
    • Sync route tree to httprouter latest code (#​2368)
    • chore: rename getQueryCache/getFormCache to initQueryCache/initFormCa (#​2375)
    • chore(performance): improve countParams (#​2378)
    • Remove some functions that have the same effect as the bytes package (#​2387)
    • update:SetMode function (#​2321)
    • remove a unused type SecureJSONPrefix (#​2391)
    • Add a redirect sample for POST method (#​2389)
    • Add CustomRecovery builtin middleware (#​2322)
    • binding: avoid 2038 problem on 32-bit architectures (#​2450)
    • Prevent panic in Context.GetQuery() when there is no Request (#​2412)
    • Add GetUint and GetUint64 method on gin.context (#​2487)
    • update content-disposition header to MIME-style (#​2512)
    • reduce allocs and improve the render WriteString (#​2508)
    • implement ".Unwrap() error" on Error type (#​2525) (#​2526)
    • Allow bind with a map[string]string (#​2484)
    • chore: update tree (#​2371)
    • Support binding for slice/array obj [Rewrite] (#​2302)
    • basic auth: fix timing oracle (#​2609)
    • Add mixed param and non-param paths (port of httprouter#​329) (#​2663)
    • feat(engine): add trustedproxies and remoteIP (#​2632)

    Configuration

    📅 Schedule: At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 4
  • Update module github.com/spf13/viper to v1.10.1

    Update module github.com/spf13/viper to v1.10.1

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | github.com/spf13/viper | require | patch | v1.10.0 -> v1.10.1 |


    Release Notes

    spf13/viper

    v1.10.1

    Compare Source

    This is a maintenance release upgrading the Consul dependency fixing CVEs.


    Configuration

    📅 Schedule: At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 3
  • Update redis Docker tag to v6

    Update redis Docker tag to v6

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Update | Change | |---|---|---| | redis | major | 5.0.10-alpine -> 6.2.5-alpine |


    Configuration

    📅 Schedule: At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 3
  • Update golang Docker tag to v1.17.0

    Update golang Docker tag to v1.17.0

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | golang | stage | minor | 1.15.7 -> 1.17.0 |


    Configuration

    📅 Schedule: At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 3
  • Replace legacy logger

    Replace legacy logger

    if there is many connections, logger sometimes fail with this error.

    Failed to close log &{0xc00008e900}: close var/logs/2020-12-31.log: file already closed
    exit status 1
    
    type: bug priority: highest 
    opened by Clivern 3
  • Flutter Support

    Flutter Support

    i am trying to connect to beaver server with webscket first i try it with basic connection soket server is working with me but when i try it with beaver thats what happened

    I/flutter ( 1396): AsyncSnapshot(ConnectionState.done, null, WebSocketChannelException: WebSocketChannelException: WebSocketException: Connection to 'https://go-beaver-k8s-1.nimi24.com:0/#' was not upgraded to websocket)

    That issue its need config in flutter or from beaver server ??

    Also i send token to server url and token inside header IOWebSocketChannel.connect( 'ws://go-beaver****', headers: {'token': ''} ), Thats it.

    kind: investigate priority: medium 
    opened by Abdelrhman9623 3
  • CORS headers middleware

    CORS headers middleware

    Right now all requests forbidden do to cors restriction, when using the beaver from the browser. Is it possible to add cors middleware that will add required headers to the requests? All needed data can be described in the config file.

    For example, the middleware may be something like that:

    func Cors(allowedMethods, allowedHeaders []string, allowedOriginPattern string) gin.HandlerFunc {
    	return func(c *gin.Context) {
    		r := c.Request
    		w := c.Writer
    
    		w.Header().Set("Content-Type", "application/json; charset=utf-8")
    		w.Header().Set("Access-Control-Allow-Methods", strings.Join(allowedMethods, ", "))
    		w.Header().Set("Access-Control-Allow-Headers", strings.Join(allowedHeaders, ", "))
    
    		reqOrigin := r.Header.Get("Origin")
    
    		switch allowedOriginPattern {
    		case "*", ".*", "/*":
    			w.Header().Set("Access-Control-Allow-Origin", "*")
    		default:
    			if ok, _ := regexp.MatchString(allowedOriginPattern, reqOrigin); ok {
    				w.Header().Set("Access-Control-Allow-Origin", reqOrigin)
    			}
    		}
    
    		if r.Method == "OPTIONS" {
    			c.AbortWithStatus(http.StatusOK)
    		} else {
    			c.Next()
    		}
    	}
    }
    
    type: bug 
    opened by OlegBabkin 3
  • fix client unsubscribe channel

    fix client unsubscribe channel

    Here is the info of client 7a3d37c0-9706-4570-add0-2a9c41ab251a after subscribing to 4 channels

    curl -X GET \
        -H 'Content-Type: application/json' \
        -H 'X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD' \
        -d '' \
        'http://localhost:8080/api/client/7a3d37c0-9706-4570-add0-2a9c41ab251a'
    {"channels":["app_x_chatroom_1","app_x_chatroom_2","app_x_chatroom_3","app_x_chatroom_4"],"created_at":1582012347,"id":"7a3d37c0-9706-4570-add0-2a9c41ab251a","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoiN2EzZDM3YzAtOTcwNi00NTcwLWFkZDAtMmE5YzQxYWIyNTFhQDE1ODIwMTIzNDciLCJ0aW1lc3RhbXAiOjE1ODIwMTIzNDd9.6KYv9wLEoLhUxsdYutO1czzRsWamWu5OWlXS1Yobr78","updated_at":1582012347}
    

    then unsubscribe channel app_x_chatroom_2

    curl -X PUT \
        -H 'Content-Type: application/json' \
        -H 'X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD' \
        -d '{"channels": ["app_x_chatroom_2"]}' \
        'http://localhost:8080/api/client/7a3d37c0-9706-4570-add0-2a9c41ab251a/unsubscribe'
    

    get the info again

    curl -X GET \
        -H 'Content-Type: application/json' \
        -H 'X-AUTH-TOKEN: sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD' \
        -d '' \
        'http://localhost:8080/api/client/7a3d37c0-9706-4570-add0-2a9c41ab251a'
    {"channels":["app_x_chatroom_4","app_x_chatroom_2","app_x_chatroom_3"],"created_at":1582012347,"id":"7a3d37c0-9706-4570-add0-2a9c41ab251a","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoiN2EzZDM3YzAtOTcwNi00NTcwLWFkZDAtMmE5YzQxYWIyNTFhQDE1ODIwMTIzNDciLCJ0aW1lc3RhbXAiOjE1ODIwMTIzNDd9.6KYv9wLEoLhUxsdYutO1czzRsWamWu5OWlXS1Yobr78","updated_at":1582012347}
    

    channel app_x_chat_room_1 is removed unexpectedly, while app_x_chatroom_2 is still in the channel list

    opened by hongnguyenhuu96 3
  • Unsubscribe not working

    Unsubscribe not working

    Describe the bug the client get channel message after unsubscribe this channel

    Development or production environment https://github.com/Clivern/Beaver/releases/download/1.1.1/Beaver_1.1.1_Linux_x86_64.tar.gz

    type: awaiting-more-evidence 
    opened by gozeon 3
  • Bump github.com/spf13/viper from 1.11.0 to 1.12.0

    Bump github.com/spf13/viper from 1.11.0 to 1.12.0

    Bumps github.com/spf13/viper from 1.11.0 to 1.12.0.

    Release notes

    Sourced from github.com/spf13/viper's releases.

    v1.12.0

    This release makes YAML v3 and TOML v2 the default versions used for encoding.

    You can switch back to the old versions by adding viper_yaml2 and viper_toml1 to the build tags.

    Please note that YAML v2 and TOML v1 are considered deprecated from this release and may be removed in a future release.

    Please provide feedback in discussions and report bugs on the issue tracker. Thanks!

    What's Changed

    Exciting New Features 🎉

    Enhancements 🚀

    Dependency Updates ⬆️

    New Contributors

    Full Changelog: https://github.com/spf13/viper/compare/v1.11.0...v1.12.0

    Commits
    • 4322cf2 feat: make toml2 the default
    • 8d02999 feat: make yaml3 the default
    • 7c35aa9 chore(deps): update yaml3
    • 433821f feat: add etcd3 support to remote
    • 2080d43 chore: update crypt
    • da55858 chore: fix Error log calls in mergeMaps
    • f50ce90 Add in MustBindEnv.
    • 3b836e5 build(deps): bump github.com/subosito/gotenv from 1.2.0 to 1.3.0
    • 5d65186 build(deps): bump github.com/pelletier/go-toml/v2 from 2.0.0 to 2.0.1
    • 9f85518 build(deps): bump github.com/spf13/cast from 1.4.1 to 1.5.0
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 2
  • Update module go to 1.19

    Update module go to 1.19

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | go (source) | golang | minor | 1.16 -> 1.19 |


    Release Notes

    golang/go

    v1.18.3

    v1.18.2

    v1.18.1

    v1.18.0

    v1.17.12

    v1.17.11

    v1.17.10

    v1.17.9

    v1.17.8

    v1.17.7

    v1.17.6

    v1.17.5

    v1.17.4

    v1.17.3

    v1.17.2

    v1.17.1

    v1.17.0


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    Open

    These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

    Ignored or Blocked

    These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

    Detected dependencies

    github-actions
    .github/workflows/build.yml
    • actions/checkout v3
    • actions/setup-go v3
    .github/workflows/release.yml
    • actions/checkout v3
    • actions/setup-go v3
    • goreleaser/goreleaser-action v3
    .github/workflows/release_pkg.yml
    • actions/checkout v3
    • actions/setup-go v3
    gomod
    go.mod
    • go 1.16
    • github.com/dgrijalva/jwt-go v3.2.0+incompatible
    • github.com/drone/envsubst v1.0.3
    • github.com/gin-gonic/gin v1.7.7
    • github.com/go-redis/redis v6.15.9+incompatible
    • github.com/gorilla/websocket v1.5.0
    • github.com/prometheus/client_golang v1.12.2
    • github.com/satori/go.uuid v1.2.0
    • github.com/sirupsen/logrus v1.9.0
    • github.com/spf13/cobra v1.5.0
    • github.com/spf13/viper v1.12.0

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    opened by renovate[bot] 0
  • Why was it sent to the client twice?

    Why was it sent to the client twice?

    When I set the "to_client" parameter, the client will receive two duplicate messages. Why is it designed like this?

    // HandleMessages send messages to a specific connected client
    func (e *Websocket) HandleMessages() {
    
    	validate := utils.Validator{}
    
    	for {
    		// Grab the next message from the broadcast channel
    		msg := <-e.Broadcast
    
    		// Send to Client
    		if msg.IsValid() && !validate.IsEmpty(msg.ToClient) && !validate.IsEmpty(msg.Channel) && validate.IsUUID4(msg.ToClient) {
    			// Push message to that client if it still connected
    			// or remove from clients if we can't deliver messages to
    			// it anymore
    			if client, ok := e.Clients.Get(msg.ToClient); ok {
    // --------------------------------------------First--------------------------------------------------
    				err := client.(*websocket.Conn).WriteJSON(msg)
    				if err != nil {
    					client.(*websocket.Conn).Close()
    					e.Clients.Delete(msg.ToClient)
    				}
    			}
    		}
    
    		// Send to client Peers on a channel
    		if msg.IsValid() && !validate.IsEmpty(msg.FromClient) && !validate.IsEmpty(msg.Channel) && validate.IsUUID4(msg.FromClient) {
    
    			channel := api.Channel{}
    			channel.Init()
    			iter := channel.ChannelScan(msg.Channel).Iterator()
    
    			for iter.Next() {
    
    				if msg.FromClient == iter.Val() {
    					continue
    				}
    
    				msg.ToClient = iter.Val()
    
    				if msg.ToClient != "" && validate.IsUUID4(msg.ToClient) {
    					if client, ok := e.Clients.Get(msg.ToClient); ok {
    // --------------------------------------------Second--------------------------------------------------
    						err := client.(*websocket.Conn).WriteJSON(msg)
    						if err != nil {
    							client.(*websocket.Conn).Close()
    							e.Clients.Delete(msg.ToClient)
    						}
    					}
    				}
    			}
    		}
    	}
    }
    
    
    type: bug kind: investigate 
    opened by GoneGo1ng 2
  • Add Test Benchmarks

    Add Test Benchmarks

    To get an idea of the overhead added to redis and throughput of a beaver instance, some benchmarks could be added to the core application integrations to provide an idea of how many hosts an instance could serve with reference hardware.

    type: improvement priority: low 
    opened by Xeoncross 1
Releases(v1.5.0)
Owner
Ahmed
Ahmed
Uniqush is a free and open source software system which provides a unified push service for server side notification to apps on mobile devices.

Homepage Download Blog/News @uniqush Introduction Uniqush (\ˈyü-nə-ku̇sh\ "uni" pronounced as in "unified", and "qush" pronounced as in "cushion") is

Uniqush 1.4k Jul 31, 2022
Github-notifications - Small script to alert me when I have notifications on Github. I use it in my Polybar conf

Github notification polybar widget This tool is meant to be used with Polybar, in order to let the user know when they have notifications on Github. R

Ghislain Rodrigues 1 Jan 26, 2022
A dead simple Go library for sending notifications to various messaging services.

A dead simple Go library for sending notifications to various messaging services. About Notify arose from my own need for one of my api server running

Niko Köser 1.2k Aug 8, 2022
Simple-messaging - Brokerless messaging. Pub/Sub. Producer/Consumer. Pure Go. No C.

Simple Messaging Simple messaging for pub/sub and producer/consumer. Pure Go! Usage Request-Response Producer: consumerAddr, err := net.ResolveTCPAddr

IchHabeKeineNamen 1 Jan 20, 2022
Cadence is a distributed, scalable, durable, and highly available orchestration engine to execute asynchronous long-running business logic in a scalable and resilient way.

Cadence Visit cadenceworkflow.io to learn about Cadence. This repo contains the source code of the Cadence server. To implement workflows, activities

Uber Open Source 6.2k Jul 29, 2022
⚡ HTTP/2 Apple Push Notification Service (APNs) push provider for Go — Send push notifications to iOS, tvOS, Safari and OSX apps, using the APNs HTTP/2 protocol.

APNS/2 APNS/2 is a go package designed for simple, flexible and fast Apple Push Notifications on iOS, OSX and Safari using the new HTTP/2 Push provide

Adam Jones 2.7k Aug 2, 2022
Golang tool to send notifications to LINE app

Golang tool to send notifications to LINE app

Muhammad Daffa 3 Dec 15, 2021
Bark is an iOS App which allows you to push customed notifications to your iPhone.

Bark is an iOS App which allows you to push customed notifications to your iPhone.

Feng 1.4k Aug 1, 2022
Golang client for NATS, the cloud native messaging system.

NATS - Go Client A Go client for the NATS messaging system. Installation # Go client go get github.com/nats-io/nats.go/ # Server go get github.com/na

NATS - The Cloud Native Messaging System 4.1k Jul 30, 2022
High-Performance server for NATS, the cloud native messaging system.

NATS is a simple, secure and performant communications system for digital systems, services and devices. NATS is part of the Cloud Native Computing Fo

NATS - The Cloud Native Messaging System 11.3k Jul 28, 2022
A brief demo of real-time plotting with Plotly, Go, and server-sent events

Golang SSE Demo A brief demo of real-time plotting with Plotly, Go, and server-side events. Overview I first learned about Server-Sent Events from @mr

Damon P. Cortesi 15 Jul 7, 2022
nanoQ — high-performance brokerless Pub/Sub for streaming real-time data

nanoQ — high-performance brokerless Pub/Sub for streaming real-time data nanoQ is a very minimalistic (opinionated/limited) Pub/Sub transport library.

Aigent 148 Jun 7, 2022
The Bhojpur MDM is a software-as-a-service product used as a Mobile Device Manager based on Bhojpur.NET Platform for application delivery.

Bhojpur MDM - Mobile Device Manager The Bhojpur MDM is a software-as-a-service product used as a Mobile Device Manager based on Bhojpur.NET Platform f

Bhojpur Consulting 0 Dec 31, 2021
Sending line notifications using a binary, docker or Drone CI.

drone-line Sending line notifications using a binary, docker or Drone CI. Register Line BOT API Trial Please refer to LINE Business Center. Feature Se

Bo-Yi Wu 77 Jun 20, 2022
Package notify provides an implementation of the Gnome DBus Notifications Specification.

go-notify Package notify provides an implementation of the Gnome DBus Notifications Specification. Examples Display a simple notification. ntf := noti

null 61 Jun 10, 2022
Send slack notifications using Github action

Slack notification This is a simple Slack notification action which runs using a Bot token. Example Action A simple example on how to use this action:

Gergely Brautigam 12 Aug 9, 2021
ntfy is a super simple pub-sub notification service. It allows you to send desktop notifications via scripts.

ntfy ntfy (pronounce: notify) is a super simple pub-sub notification service. It allows you to send desktop and (soon) phone notifications via scripts

Philipp C. Heckel 2.6k Aug 6, 2022
A simple microservice which accepts incoming notifications

Notifier A simple microservice which accepts incoming notifications, and questions and redirects them to notification sinks such as Telegram, Email et

Albert 7 May 21, 2022
Abstraction layer for simple rabbitMQ connection, messaging and administration

Jazz Abstraction layer for quick and simple rabbitMQ connection, messaging and administration. Inspired by Jazz Jackrabbit and his eternal hatred towa

SOCIFI Ltd. 15 May 21, 2022