I am writing a chat application without explicit server side web socket. I am using RabbitMQ webstomp as the web socket container and plain Javascript as the cleint to both send and receive data.
Below is the flow : Browser -> native websocket/sockjs -> rabbitmq /sockjs websocket (ws://127.0.0.1:15674/ws or http://localhost:15674/stomp) -> put messages to queue.
However while testing the application, I am not able to send the data directly to ws://127.0.0.1:15674/ws. I am just able to connect to it.
I use the below template to send and receive data on client Javascript.
- ws = new WebSocket('ws://127.0.0.1:15674/ws');
- client = Stomp.over(ws);
- client.connect('guest','guest',on_connection,on_connect_error,'/');
- client.send(queue, {'reply-to':'/temp-queue/logs',priority: 9}, "msg" );
- client.onreceive = func()