A general purpose websocket microservice.
- C#
- .NET 6.0
- Visual Studio
- A client should subscribe to the socket first
- The server should POST to addNotification and list all user tokens/cookies in
PushToCookies
. For each token that exists in Bullhorn, it will receive a message.
To send a notification from a server:
curl -X 'POST' \
'https://localhost:7254/addNotification' \
-H 'accept: */*' \
-d '{"PushToCookies":["abc"],"Meta":{"A":"B","C":{},"D":[1,2,3]}}' \
To subscribe a client: wss://localhost:7254/wssubscribe
First subscription message schema:
{
"FromCookie": "abc"
}
Subsequent response schema:
{
"ResourceType": "nullable string",
"Meta": {
"any": {
"object": ["no matter how nested!"]
},
"whatever": "works for you"
}
}
docker pull 14jthaxton/bullhorn:1.0
ordocker build -t bullhorn .
inDockerfile
's directorydocker run -d -p 0.0.0.0:5200:5200 -p 0.0.0.0:7254:7254 -e ASPNETCORE_URLS="http://0.0.0.0:5200" -it --name bullhorn bullhorn