Skip to content

abekoh/pg_notify_sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pg_notify_sample

Example of real-time messaging using Go, PostgreSQL LISTEN/NOTIFY, and WebSocket.

Overview

Overview

Usage

Use websocat as WebSocket client.

# launch
docker compose up
go run .
# Alice
websocat 'ws://localhost:8080/ws?room_id=e5c87218-676b-4185-9335-3fe48eff6a38'
{"foo", "bar"} # send JSON message
# Bob
websocat 'ws://localhost:8080/ws?room_id=e5c87218-676b-4185-9335-3fe48eff6a38'
# {"foo", "bar"} # receive JSON message

About

Example of real-time messaging using Go, PostgreSQL LISTEN/NOTIFY, and WebSocket.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages