https://github.com/spearwolf/websocket-stomp-bridge
a simple websocket to stomp bridge
https://github.com/spearwolf/websocket-stomp-bridge
Last synced: about 1 year ago
JSON representation
a simple websocket to stomp bridge
- Host: GitHub
- URL: https://github.com/spearwolf/websocket-stomp-bridge
- Owner: spearwolf
- Created: 2010-10-03T10:58:34.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2011-06-14T08:07:04.000Z (almost 15 years ago)
- Last Synced: 2025-01-22T08:13:40.489Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 102 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A Simple WebSocket To Stomp Bridge
==================================
+-----------+
+------------------+ | websocket | +----------------------+
| websocket client |<<<---[ WebSocket ]--->>>| stomp |<<<---[ STOMP ]--->>>| stomp message broker |
| ( browser ) | | bridge | | ( activemq ) |
+------------------+ +-----------+ +----------------------+
|
______________________V_____________________
| |
| class WsStompBridge::ClientConnection |
| |
| def on_websocket_connect |
| subscribe_to '/queue/public' |
| end |
| |
| def on_websocket_message(msg) |
| publish '/queue/worker', msg |
| end |
| |
| def on_websocket_disconnect |
| #unsubscribe '/queue/public' |
| unsubscribe_all |
| end |
| |
| def on_stomp_message(msg) |
| send_to_client(msg) |
| end |
| end |
| |
============================================
© 2010 by Wolfger Schramm